commit cf1129a8b4663e93edf4914e7fd3c3dbf6452767
parent 0cd833e64bcdffbac9ec63f6c0c05fe6be4c4541
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 30 Mar 2018 10:45:04 +0200
syntax: sh: colorize options only when they are preceded by whitespace
To prevent any filenames containing hyphens getting partially colored.
Reported-by: Brand Huntsman <alpha@qzx.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc
@@ -16,7 +16,7 @@ color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
color green "-(eq|ne|gt|lt|ge|le|ef|ot|nt)\>"
# Short and long options.
-color brightmagenta "-[A-Za-z]\>" "--[A-Za-z-]+\>"
+color brightmagenta "[[:blank:]]-[A-Za-z]\>" "[[:blank:]]--[A-Za-z-]+\>"
# Common commands.
color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|cut|echo|env|grep|head|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|sort|tail|tar|touch|umask|unset)\>"