rust highlighter: '"' is not the start of a string

this uses the string opening regex from the c-family highlighter to prevent
highlighting the rest of the file as a string on encountering the character
literal '"'
This commit is contained in:
Dianne Wagner 2017-06-18 18:39:45 -07:00
parent f9c48237a7
commit 3ae0d86b27

View File

@ -12,9 +12,9 @@ hook global BufCreate .*[.](rust|rs) %{
# ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter -group / regions -default code rust \
string '"' (?<!\\)(\\\\)*" '' \
comment // $ '' \
comment /\* \*/ /\*
string %{(?<!')"} (?<!\\)(\\\\)*" '' \
comment // $ '' \
comment /\* \*/ /\*
add-highlighter -group /rust/string fill string
add-highlighter -group /rust/comment fill comment