Fix saving "Show dot files" option
Fixed correctly highlightning procedure names
This commit is contained in:
@@ -51,13 +51,34 @@ proc HighLightTCL {text line lineNumber node} {
|
||||
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
|
||||
}
|
||||
if {[string trim $word]=="proc"} {
|
||||
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
|
||||
#$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
|
||||
}
|
||||
set startPos [expr $endPos + 1]
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# Procedure name highlight
|
||||
set workLine $line
|
||||
while {$workLine != ""} {
|
||||
#regexp -nocase -all -line -- {proc (::|)(\w+)(::|)(\w+) \{(.*)\} \{} $workLine match v1 v2 v3 v4 params
|
||||
set endPos [string first "\{" $workLine]
|
||||
#puts $workLine
|
||||
if {[regexp -nocase -all -line -- {proc (::|)(\w+)(::|-|_|)(\w+)(.+) \{(.*)\} \{} $workLine match v1 v2 v3 v4 v5 params]} {
|
||||
set word "$v1$v2$v3$v4$v5"
|
||||
puts $word
|
||||
set length [string length $word]
|
||||
set startPos [string first [string trim $word] $line]
|
||||
#set endPos [expr $startPos + $length]
|
||||
set workLine [string range $workLine $length end]
|
||||
puts "$length $startPos $endPos\n$workLine"
|
||||
$text tag add procName $lineNumber.$startPos $lineNumber.$endPos
|
||||
set startPos [expr $endPos + 1]
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
set workLine $line
|
||||
while {$workLine != ""} {
|
||||
if {[regexp {(\{|\[)[a-zA-Z\\_:]+} $workLine word v]} {
|
||||
@@ -213,4 +234,3 @@ proc HighLightTCL {text line lineNumber node} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user