diff options
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 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 |