syntax: nanorc: don't color parts of valid strings as if invalid
It's better to color some invalid things as if valid than the other way around. So, as strings can validly contain any number of double quotes, just accept *anything* between the delimiting double quotes and demand that the closing quote is followed by whitespace or EOL.master
parent
0133d5cba8
commit
4761e00852
|
@ -16,12 +16,13 @@ icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]
|
||||||
icolor brightgreen "^[[:space:]]*(linter|formatter)[[:space:]]+[[:alpha:]]+"
|
icolor brightgreen "^[[:space:]]*(linter|formatter)[[:space:]]+[[:alpha:]]+"
|
||||||
icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|extendsyntax)\>"
|
icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|extendsyntax)\>"
|
||||||
|
|
||||||
|
# Strings
|
||||||
|
color brightmagenta "".+"([[:space:]]|$)"
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||||
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||||
|
|
||||||
# Strings
|
|
||||||
color brightmagenta ""(\\.|[^"])*""
|
|
||||||
# Comments
|
# Comments
|
||||||
color brightblue "(^|[[:space:]]+)#.*$"
|
color brightblue "(^|[[:space:]]+)#.*$"
|
||||||
color cyan "^[[:space:]]*##.*$"
|
color cyan "^[[:space:]]*##.*$"
|
||||||
|
|
Loading…
Reference in New Issue