diff options
author | fvogel <fvogel@noemail.net> | 2015-11-08 21:44:40 (GMT) |
---|---|---|
committer | fvogel <fvogel@noemail.net> | 2015-11-08 21:44:40 (GMT) |
commit | 05dfb89eeaef347b9d8d188513a96160743bc1b9 (patch) | |
tree | 61d83dfed3c66f2e2f56e233c2cc328dc27f3a7e /library | |
parent | f12e7ad3a25f4267718e0f8f6ca87b137686ad6b (diff) | |
parent | b1557c55618517516ba5b7ecb8748f50afbca35b (diff) | |
download | tk-05dfb89eeaef347b9d8d188513a96160743bc1b9.zip tk-05dfb89eeaef347b9d8d188513a96160743bc1b9.tar.gz tk-05dfb89eeaef347b9d8d188513a96160743bc1b9.tar.bz2 |
Fixed entry (and final) part of bug [542199fff] - Double click on a lone character in an entry does not work
FossilOrigin-Name: e1b50df1d2da7e9fdbab511cbe18d4e3ae0fef61
Diffstat (limited to 'library')
-rw-r--r-- | library/entry.tcl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/library/entry.tcl b/library/entry.tcl index 382cc88..c3e573d 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -373,12 +373,18 @@ proc ::tk::EntryMouseSelect {w x} { } } word { - if {$cur < [$w index anchor]} { + if {$cur < $anchor} { set before [tcl_wordBreakBefore [$w get] $cur] set after [tcl_wordBreakAfter [$w get] [expr {$anchor-1}]] - } else { + } elseif {$cur > $anchor} { set before [tcl_wordBreakBefore [$w get] $anchor] set after [tcl_wordBreakAfter [$w get] [expr {$cur - 1}]] + } else { + if {[$w index @$Priv(pressX)] < $anchor} { + incr anchor -1 + } + set before [tcl_wordBreakBefore [$w get] $anchor] + set after [tcl_wordBreakAfter [$w get] $anchor] } if {$before < 0} { set before 0 |