Добавлена подсветка и навигация по HTML. Исправлена подсветка XML

This commit is contained in:
svkalinin 2022-12-09 11:25:34 +03:00
parent cfae63d36a
commit 28ceaf1c67
2 changed files with 16 additions and 2 deletions

View File

@ -88,12 +88,21 @@ namespace eval Highlight {} {
} }
proc XML {txt} { proc XML {txt} {
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)} ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}
ctext::addHighlightClassForRegexp $txt stackControl #19a2a6 {(<|<\\)*?[\w]+>} ctext::addHighlightClassForRegexp $txt stackControl #19a2a6 {(<|<\\)*?[\w]+(/|)(>)}
ctext::addHighlightClassForRegexp $txt vars #4471ca {(\$|\*|\&)[\.a-zA-Z0-9\_\-]+} ctext::addHighlightClassForRegexp $txt vars #4471ca {(\$|\*|\&)[\.a-zA-Z0-9\_\-]+}
ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()} ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
# ctext::addHighlightClassForRegexp $txt paths lightblue {\.[a-zA-Z0-9\_\-]+} # ctext::addHighlightClassForRegexp $txt paths lightblue {\.[a-zA-Z0-9\_\-]+}
# ctext::addHighlightClassForRegexp $txt comments #666666 {(#|//)[^\n\r]*} # ctext::addHighlightClassForRegexp $txt comments #666666 {(#|//)[^\n\r]*}
ctext::addHighlightClassForSpecialChars $txt tags #666666 {<>/} ctext::addHighlightClassForSpecialChars $txt tags lightgreen {<>/}
}
proc HTML {txt} {
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}
ctext::addHighlightClassForRegexp $txt stackControl #19a2a6 {(<|</)([\w]+)}
ctext::addHighlightClassForRegexp $txt vars #4471ca {(\$|\*|\&)[\.a-zA-Z0-9\_\-]+}
ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
ctext::addHighlightClassForRegexp $txt paths lightblue {(\s)([\w]+)(=)}
ctext::addHighlightClassForSpecialChars $txt tags lightgreen {<>/}
ctext::addHighlightClassForRegexp $txt comments #666666 {(<\!--)\s*(.+)\s*(-->)}
} }
proc RB {txt} { proc RB {txt} {
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)} ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}

View File

@ -71,5 +71,10 @@ dict set lexers INI tabSize 4
dict set lexers INI procFindString {(\[)PROCNAME(\])} dict set lexers INI procFindString {(\[)PROCNAME(\])}
dict set lexers INI procRegexpCommand {regexp -nocase -all -- {^\s*?(\[)([a-zA-Z0-9\-_:]+?)(\])$} $line match keyWord procName} dict set lexers INI procRegexpCommand {regexp -nocase -all -- {^\s*?(\[)([a-zA-Z0-9\-_:]+?)(\])$} $line match keyWord procName}
dict set lexers HTML commentSymbol {<\!--}
dict set lexers HTML tabSize 4
dict set lexers HTML procFindString {<h[0-9]>(<.+>|)PROCNAME(</.+>|)</h[0-9]>}
dict set lexers HTML procRegexpCommand {regexp -nocase -all -- {<h[0-9]>(<.+>|)(.+?)(</.+>|)</h[0-9]>} $line match v1 procName v2}
# ------------------------------------------------- # -------------------------------------------------
dict set lexers ALL varDirectory {variables vars group_vars host_vars defaults} dict set lexers ALL varDirectory {variables vars group_vars host_vars defaults}