[sh] Do not highlight keywords if preceded/succeeded by a hyphen
This commit is contained in:
parent
75bb796b2b
commit
8dbc86c54a
|
@ -48,10 +48,10 @@ evaluate-commands %sh{
|
|||
printf %s\\n "declare-option str-list sh_static_words $(join "${keywords}" ' ') $(join "${builtins}" ' ')"
|
||||
|
||||
# Highlight keywords
|
||||
printf %s\\n "add-highlighter shared/sh/code/ regex \b($(join "${keywords}" '|'))\b 0:keyword"
|
||||
printf %s\\n "add-highlighter shared/sh/code/ regex (?<!-)\b($(join "${keywords}" '|'))\b(?!-) 0:keyword"
|
||||
|
||||
# Highlight builtins
|
||||
printf %s "add-highlighter shared/sh/code/builtin regex \b($(join "${builtins}" '|'))\b 0:builtin"
|
||||
printf %s "add-highlighter shared/sh/code/builtin regex (?<!-)\b($(join "${builtins}" '|'))\b(?!-) 0:builtin"
|
||||
}
|
||||
|
||||
add-highlighter shared/sh/code/operators regex [\[\]\(\)&|]{1,2} 0:operator
|
||||
|
|
Loading…
Reference in New Issue
Block a user