summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2014-02-22 17:23:25 +0000
committerNick White <git@njw.me.uk>2014-02-22 17:23:25 +0000
commitd663260fd331d9aae4b9a5fe669f1d1d12e4cbc2 (patch)
tree20c8d7876d7b284bfaa07f44aaa87f02e47dfac0
parentb071f6a1d026be2fdbac4ee6e7c2a044407817c3 (diff)
downloadtkread-d663260fd331d9aae4b9a5fe669f1d1d12e4cbc2.tar.bz2
tkread-d663260fd331d9aae4b9a5fe669f1d1d12e4cbc2.zip
Fix underline matching properly
-rwxr-xr-xtkread8
1 files changed, 4 insertions, 4 deletions
diff --git a/tkread b/tkread
index 60fcbf4..4a712b8 100755
--- a/tkread
+++ b/tkread
@@ -45,8 +45,8 @@ set surroundfmt { \
}
set underlinefmt { \
- {"==" "6" ""} \
- {"--" "3" "italic"} \
+ {"=" "6" ""} \
+ {"-" "3" "italic"} \
}
if { $::argc > 0 && [lindex $::argv 0] == "-h" } {
@@ -161,14 +161,14 @@ proc markup {widget} {
set fmtsizemod [lindex $fmt 1]
set fmtstring [lindex $fmt 2]
- set cur [$widget search -regexp "^$searchchar" 0.0 end]
+ set cur [$widget search -regexp "^$searchchar$searchchar*\$" 0.0 end]
while {$cur != ""} {
set dotindex [string first . $cur]
set linenum [string range $cur 0 [expr $dotindex - 1]]
$widget tag add underline_$underlinenum [expr $linenum - 1].0 $linenum.end
$widget delete $linenum.0 [expr $linenum + 1].0
- set cur [$widget search -regexp "^$searchchar" [expr $linenum + 1].0 end]
+ set cur [$widget search -regexp "^$searchchar$searchchar*\$" [expr $linenum + 1].0 end]
}
$widget tag configure underline_$underlinenum -font "{$fontfamily} [expr $fontsize + $fmtsizemod] $fmtstring"
incr underlinenum