summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-07-03 12:36:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-07-03 12:36:32 (GMT)
commit87a8f9904ac353083d602b4929fbbca259f64271 (patch)
tree9bdcc783bc4566fafb82a64c6caecf7a597442d3 /library
parent4d36a570dbba57b3a47c9d514b5e5b425053b46f (diff)
parente2ab0fe9d3d4cceee9533e22a3cc5aaf7d2e2f70 (diff)
downloadtk-87a8f9904ac353083d602b4929fbbca259f64271.zip
tk-87a8f9904ac353083d602b4929fbbca259f64271.tar.gz
tk-87a8f9904ac353083d602b4929fbbca259f64271.tar.bz2
Merge 8.6
Diffstat (limited to 'library')
-rw-r--r--library/entry.tcl10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/entry.tcl b/library/entry.tcl
index 02384da..1eda8ed 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -518,9 +518,9 @@ proc ::tk::EntryBackspace w {
if {[$w selection present]} {
$w delete sel.first sel.last
} else {
- set x [expr {[$w index insert] - 1}]
- if {$x >= 0} {
- $w delete $x
+ set x [$w index insert]
+ if {$x > 0} {
+ $w delete [expr {$x - 1}]
}
if {[$w index @0] >= [$w index insert]} {
set range [$w xview]
@@ -575,10 +575,10 @@ proc ::tk::EntryTranspose w {
if {$i < [$w index end]} {
incr i
}
- set first [expr {$i-2}]
- if {$first < 0} {
+ if {$first < 2} {
return
}
+ set first [expr {$i-2}]
set data [$w get]
set new [string index $data [expr {$i-1}]][string index $data $first]
$w delete $first $i