diff options
author | fvogel <fvogelnew1@free.fr> | 2015-11-08 21:50:06 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-11-08 21:50:06 (GMT) |
commit | 8e14ee04b3964bb9118b78ee62722fbf9f2129cb (patch) | |
tree | eb001f13d086e69bab191048fdc73f97cc539967 | |
parent | 3ab946c3a13a9f42cf14322a908810eb56a2d4f5 (diff) | |
parent | 77e0e5439c5a1f5716149e2fa3ee0dcc8c63e56f (diff) | |
download | tk-8e14ee04b3964bb9118b78ee62722fbf9f2129cb.zip tk-8e14ee04b3964bb9118b78ee62722fbf9f2129cb.tar.gz tk-8e14ee04b3964bb9118b78ee62722fbf9f2129cb.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 | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/library/entry.tcl b/library/entry.tcl index f7170f7..6243d26 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -357,12 +357,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 1548467..756dbe5 100644 --- a/tests/event.test +++ b/tests/event.test @@ -756,9 +756,7 @@ test event-7.1(double-click) {A double click on a lone character deleteWindows } -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} -constraints { - knownBug -} -setup { + in an entry widget should select that character} -setup { deleteWindows } -body { set t [toplevel .t] @@ -822,7 +820,7 @@ test event-7.2(double-click) {A double click on a lone character return $result } -cleanup { deleteWindows -} -result {3 A 4 A} +} -result {4 A 4 A} # cleanup unset -nocomplain keypress_lookup |