summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-30 09:58:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-30 09:58:25 (GMT)
commit9d377d42451b27ab52f741aed2b59afa9ca8b27d (patch)
treedb88dd5514a7ec52cc9fb37a431411f987a85aea /library/text.tcl
parent309e2d177f708125a52e88368079ee62b71be0ef (diff)
parent1ed6e3fd56d286fd7d7fc4a426cf223dbf1bb26b (diff)
downloadtk-9d377d42451b27ab52f741aed2b59afa9ca8b27d.zip
tk-9d377d42451b27ab52f741aed2b59afa9ca8b27d.tar.gz
tk-9d377d42451b27ab52f741aed2b59afa9ca8b27d.tar.bz2
Merge 8.6
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/text.tcl b/library/text.tcl
index 62db560..6d3df8e 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -1278,7 +1278,11 @@ proc ::tk::TextUndoRedoProcessMarks {w} {
set nUndoMarks [llength $undoMarks]
set n [expr {$nUndoMarks / 2}]
set undoMarks [lsort -dictionary $undoMarks]
- set Lmarks [lrange $undoMarks 0 [expr {$n - 1}]]
+ if {$n > 0} {
+ set Lmarks [lrange $undoMarks 0 [expr {$n - 1}]]
+ } else {
+ set Lmarks {}
+ }
set Rmarks [lrange $undoMarks $n [llength $undoMarks]]
foreach Lmark $Lmarks Rmark $Rmarks {
lappend indices [$w index $Lmark] [$w index $Rmark]