commit 3f3698640b1bad61df036c4475cbd572b70b5f64
parent 432388b23e62fcaf0639d1182465d4572d2e4669
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 27 Oct 2019 16:34:06 +0100
syntax: ruby: colorize also lowercase global/instance variables
And avoid recoloring the reserved words BEGIN and END as constants.
Inspired-by: Rory Thrasher <thrasher@redhat.com>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/syntax/ruby.nanorc b/syntax/ruby.nanorc
@@ -6,11 +6,11 @@ magic "Ruby script"
linter ruby -w -c
comment "#"
+# Constants.
+color brightblue "\<[A-Z]+[0-9A-Z_a-z]*|(\$|@|@@)[0-9A-Z_a-z]+"
# Reserved words.
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module)\>"
color yellow "\<(next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
-# Constants.
-color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
# Ruby "symbols".
color magenta "([ ]|^):[0-9A-Za-z_]+\>"
# Some unique things we want to stand out.