summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl33
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.