commit ee91c51e091a505cb6c9813b48bd3b32c95ab408
parent 1e3f3a7511d5f21f6fc7ada2c5d5e12693ab3613
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 8 Aug 2019 12:08:34 +0200
syntax: perl: avoid recognizing embedded hash signs as a comment starter
Require that a comment starts at the start of a line or is preceded by
whitespace. This prevents most hash signs used for other purposes (and
what follows them) getting colored as comments.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/syntax/perl.nanorc b/syntax/perl.nanorc
@@ -11,5 +11,8 @@ icolor cyan start="[$@%]" end="( |[^0-9A-Z_]|-)"
color yellow "".*"|qq\|.*\|"
color white "[sm]/.*/"
color white start="(^use| = new)" end=";"
-color green "#.*"
+
+# Comments.
+color green "(^|[[:space:]])#.*"
+
color yellow start="<< 'STOP'" end="STOP"