summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-04-14 19:49:22 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-04-14 19:49:22 (GMT)
commit75a78d19b6bc075bdad415daaba87bc6f6a27ecf (patch)
tree0188e3f69b8fc8b6f15f58ed2ff0bd37adb3b6e8 /library/text.tcl
parenta955dbaac96f1fbdba1e1b4b197703ac45a2e5f0 (diff)
downloadtk-75a78d19b6bc075bdad415daaba87bc6f6a27ecf.zip
tk-75a78d19b6bc075bdad415daaba87bc6f6a27ecf.tar.gz
tk-75a78d19b6bc075bdad415daaba87bc6f6a27ecf.tar.bz2
Ticket [c8ccd1899c]. Make the guard code in proc ::tk::TextUpDownLine work as intended when moving the cursor downwards. Also, fix the bug in the index returned by the displayline modifier: the first displayed index shall be returned when the index calculated by the displayline modifier would be before the start of the displayed text.
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/text.tcl b/library/text.tcl
index 468696b..822f8e6 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -912,7 +912,7 @@ 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] \
+ if {[$w compare $new == "end - 1 display char"] \
|| [$w compare $new == "insert display linestart"]} {
set new $i
}