summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtkread9
1 files changed, 4 insertions, 5 deletions
diff --git a/tkread b/tkread
index 5a3038c..93efa40 100755
--- a/tkread
+++ b/tkread
@@ -187,7 +187,7 @@ proc markup {widget} {
set cur [$widget search "](" $cur end]
if {$cur == ""} { break }
set altend $cur
- set srcstart [indexmovechar $cur "+ 1"]
+ set srcstart [indexmovechar $cur "+ 2"]
set cur [$widget search ")" $cur end]
if {$cur == ""} { break }
set srcend $cur
@@ -195,11 +195,10 @@ proc markup {widget} {
set alt [$widget get $altstart $altend]
set src [$widget get $srcstart $srcend]
- $widget delete [indexmovechar $altstart "- 1"] [indexmovechar $srcend "+ 1"]
- set insertion [indexmovechar $altstart "- 1"]
- $widget insert $insertion $alt
+ $widget delete $altend [indexmovechar $srcend "+ 1"]
+ $widget delete [indexmovechar $altstart "- 1"] $altstart
- set cur [indexmovechar $insertion "+ [string length $alt]"]
+ set cur [indexmovechar $altend "- 1"]
set cur [$widget search {[} $cur end]
}