diff options
author | fvogel <fvogelnew1@free.fr> | 2015-11-08 21:44:40 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-11-08 21:44:40 (GMT) |
commit | 77e0e5439c5a1f5716149e2fa3ee0dcc8c63e56f (patch) | |
tree | 61d83dfed3c66f2e2f56e233c2cc328dc27f3a7e | |
parent | 039265e2a240d17e785c3d0d55fa6a108e53f44e (diff) | |
parent | f265ae7f9741d5710decdabc637b2fa3ac105a0d (diff) | |
download | tk-77e0e5439c5a1f5716149e2fa3ee0dcc8c63e56f.zip tk-77e0e5439c5a1f5716149e2fa3ee0dcc8c63e56f.tar.gz tk-77e0e5439c5a1f5716149e2fa3ee0dcc8c63e56f.tar.bz2 |
Fixed entry (and final) part of bug [542199fff] - Double click on a lone character in an entry does not work
-rw-r--r-- | library/entry.tcl | 10 | ||||
-rw-r--r-- | tests/event.test | 4 |
2 files changed, 10 insertions, 4 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 diff --git a/tests/event.test b/tests/event.test index fa75610..95be5f4 100644 --- a/tests/event.test +++ b/tests/event.test @@ -705,7 +705,7 @@ test event-7.1(double-click) {A double click on a lone character set result } {1.3 A 1.3 A} test event-7.2(double-click) {A double click on a lone character\ - in an entry widget should select that character} {knownBug} { + in an entry widget should select that character} { destroy .t set t [toplevel .t] set e [entry $t.e] @@ -766,7 +766,7 @@ test event-7.2(double-click) {A double click on a lone character\ lappend result [_get_selection $e] set result -} {3 A 4 A} +} {4 A 4 A} # cleanup |