diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-10-25 13:50:48 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-10-25 13:50:48 (GMT) |
commit | a1aa5db27d847d7c7421fedcc0a14a4d071f7b8e (patch) | |
tree | 7523c9d6e8cf1ab2e3f8b092457c087da9397b9e /library | |
parent | 2e0a87dbffb1e729ecf5a7f523eecf75be28f8ef (diff) | |
download | tk-a1aa5db27d847d7c7421fedcc0a14a4d071f7b8e.zip tk-a1aa5db27d847d7c7421fedcc0a14a4d071f7b8e.tar.gz tk-a1aa5db27d847d7c7421fedcc0a14a4d071f7b8e.tar.bz2 |
Fix [Bug 1854913] by improving the class bindings.
Diffstat (limited to 'library')
-rw-r--r-- | library/text.tcl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/library/text.tcl b/library/text.tcl index 8130d93..fc98743 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: text.tcl,v 1.41.4.1 2008/11/12 22:17:02 patthoyts Exp $ +# RCS: @(#) $Id: text.tcl,v 1.41.4.2 2009/10/25 13:50:48 dkf Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -211,15 +211,19 @@ bind Text <Delete> { if {[%W tag nextrange sel 1.0 end] ne ""} { %W delete sel.first sel.last } else { - %W delete insert + if {[%W compare end != insert+1c]} { + %W delete insert + } %W see insert } } bind Text <BackSpace> { if {[%W tag nextrange sel 1.0 end] ne ""} { %W delete sel.first sel.last - } elseif {[%W compare insert != 1.0]} { - %W delete insert-1c + } else { + if {[%W compare insert != 1.0]} { + %W delete insert-1c + } %W see insert } } @@ -296,7 +300,7 @@ bind Text <Control-b> { } } bind Text <Control-d> { - if {!$tk_strictMotif} { + if {!$tk_strictMotif && [%W compare end != insert+1c]} { %W delete insert } } @@ -311,7 +315,7 @@ bind Text <Control-f> { } } bind Text <Control-k> { - if {!$tk_strictMotif} { + if {!$tk_strictMotif && [%W compare end != insert+1c]} { if {[%W compare insert == {insert lineend}]} { %W delete insert } else { @@ -355,7 +359,7 @@ bind Text <Meta-b> { } } bind Text <Meta-d> { - if {!$tk_strictMotif} { + if {!$tk_strictMotif && [%W compare end != insert+1c]} { %W delete insert [tk::TextNextWord %W insert] } } @@ -742,7 +746,6 @@ proc ::tk::TextAutoScan {w} { # pos - The desired new position for the cursor in the window. proc ::tk::TextSetCursor {w pos} { - if {[$w compare $pos == end]} { set pos {end - 1 chars} } @@ -765,7 +768,6 @@ proc ::tk::TextSetCursor {w pos} { # actually been moved to this position yet). proc ::tk::TextKeySelect {w new} { - set anchorname [tk::TextAnchor $w] if {[$w tag nextrange sel 1.0 end] eq ""} { if {[$w compare $new < insert]} { |