diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-02-19 12:49:39 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-02-19 12:49:39 (GMT) |
commit | da63c086bf3b50960484815e9b945b159db160d9 (patch) | |
tree | bcd7d28351b15c3ccdf99e6fcfae078e28ad3a4b /library/text.tcl | |
parent | 6b9da83c1bf59f6217a4b8918e933a146ccb93e8 (diff) | |
parent | 76acfc3d9d190b8c24dfddc364e45f0ecf5eb5c1 (diff) | |
download | tk-da63c086bf3b50960484815e9b945b159db160d9.zip tk-da63c086bf3b50960484815e9b945b159db160d9.tar.gz tk-da63c086bf3b50960484815e9b945b159db160d9.tar.bz2 |
Merge 8.7
Diffstat (limited to 'library/text.tcl')
-rw-r--r-- | library/text.tcl | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/library/text.tcl b/library/text.tcl index 99d5841..15bdef2 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -138,7 +138,7 @@ bind Text <<SelectPrevWord>> { tk::TextKeySelect %W [tk::TextPrevPos %W insert tk::startOfPreviousWord] } bind Text <<SelectNextWord>> { - tk::TextKeySelect %W [tk::TextNextWord %W insert] + tk::TextKeySelect %W [tk::TextSelectNextWord %W insert] } bind Text <<SelectPrevPara>> { tk::TextKeySelect %W [tk::TextPrevPara %W insert] @@ -1086,26 +1086,31 @@ proc ::tk_textPaste w { } # ::tk::TextNextWord -- -# Returns the index of the next word position after a given position in the -# text. The next word is platform dependent and may be either the next -# end-of-word position or the next start-of-word position after the next -# end-of-word position. +# Returns the index of the next start-of-word position after the next +# end-of-word position after a given position in the text. # # Arguments: # w - The text window in which the cursor is to move. # start - Position at which to start search. -if {[tk windowingsystem] eq "win32"} { - proc ::tk::TextNextWord {w start} { - TextNextPos $w [TextNextPos $w $start tk::endOfWord] \ - tk::startOfNextWord - } -} else { - proc ::tk::TextNextWord {w start} { - TextNextPos $w $start tk::endOfWord - } +proc ::tk::TextNextWord {w start} { + TextNextPos $w [TextNextPos $w $start tk::endOfWord] \ + tk::startOfNextWord +} + +# ::tk::TextSelectNextWord -- +# Returns the index of the next end-of-word position after a given +# position in the text. +# +# Arguments: +# w - The text window in which the cursor is to move. +# start - Position at which to start search. + +proc ::tk::TextSelectNextWord {w start} { + TextNextPos $w $start tk::endOfWord } + # ::tk::TextNextPos -- # Returns the index of the next position after the given starting # position in the text as computed by a specified function. |