diff options
author | dgp <dgp@users.sourceforge.net> | 2019-08-26 19:11:12 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-08-26 19:11:12 (GMT) |
commit | 06d12e69e9974547cb077ad90a2fbff640b8d5ee (patch) | |
tree | 23550d1902716e5c083b347d73f0a939d724d83f /library | |
parent | 171381d8009cc763805f4a9553b02d114f4ce994 (diff) | |
parent | e5845ff546364f25ae5975f00bf7e2756f4d692d (diff) | |
download | tk-06d12e69e9974547cb077ad90a2fbff640b8d5ee.zip tk-06d12e69e9974547cb077ad90a2fbff640b8d5ee.tar.gz tk-06d12e69e9974547cb077ad90a2fbff640b8d5ee.tar.bz2 |
merge 8.6
Diffstat (limited to 'library')
-rw-r--r-- | library/text.tcl | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/library/text.tcl b/library/text.tcl index 60bf497..f43366b 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -900,11 +900,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 +920,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 } |