summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl29
1 files changed, 19 insertions, 10 deletions
diff --git a/library/text.tcl b/library/text.tcl
index 788a6b9..964a5fb 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -468,7 +468,7 @@ if {[tk windowingsystem] eq "aqua"} {
}
}
-if {"x11" eq [tk windowingsystem]} {
+if {[tk windowingsystem] eq "x11"} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
@@ -493,6 +493,16 @@ if {"x11" eq [tk windowingsystem]} {
%W xview scroll 50 pixels
}
}
+ bind Text <6> {
+ if {!$tk_strictMotif} {
+ %W xview scroll -50 pixels
+ }
+ }
+ bind Text <7> {
+ if {!$tk_strictMotif} {
+ %W xview scroll 50 pixels
+ }
+ }
}
# ::tk::TextClosestGap --
@@ -900,11 +910,10 @@ proc ::tk::TextInsert {w s} {
# ::tk::TextUpDownLine --
# Returns the index of the character one display line above or below the
-# insertion cursor. There are two tricky things here. First, we want to
-# maintain the original x position across repeated operations, even though
-# some lines that will get passed through don't have enough characters to
-# cover the original column. Second, don't try to scroll past the
-# beginning or end of the text.
+# insertion cursor. There is a tricky thing here: we want to maintain the
+# original x position across repeated operations, even though some lines
+# that will get passed through don't have enough characters to cover the
+# original column.
#
# Arguments:
# w - The text window in which the cursor is to move.
@@ -921,11 +930,11 @@ proc ::tk::TextUpDownLine {w n} {
set lines [$w count -displaylines $Priv(textPosOrig) $i]
set new [$w index \
"$Priv(textPosOrig) + [expr {$lines + $n}] displaylines"]
- if {[$w compare $new == end] \
- || [$w compare $new == "insert display linestart"]} {
- set new $i
- }
set Priv(prevPos) $new
+ if {[$w compare $new == "end display lineend"] \
+ || [$w compare $new == "insert display linestart"]} {
+ set Priv(textPosOrig) $new
+ }
return $new
}