diff options
-rwxr-xr-x | tkread | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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] } |