commit 375b30507ea60b49bffe759b3d8810c478482001
parent 7691527f35ca063b9a4050969cde73e8fc1b7993
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 25 Oct 2021 13:32:10 +0200
syntax: ruby: colorize embedded documentation as a comment
Vim and Emacs do this too.
Reference:
https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Lexicology
Also, when colorizing double-hashed comments specially anyway,
avoid colorizing ##.* as a single-hashed comment.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/syntax/ruby.nanorc b/syntax/ruby.nanorc
@@ -30,8 +30,9 @@ color brightgreen "#\{[^}]*\}"
color green "'([^']|\\')*'" "%[qw](\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
# Comments.
-color cyan "#([^{].*|$)"
+color cyan "#([^{#].*|$)"
color brightcyan "##([^{].*|$)"
+color cyan start="^=begin\>" end="^=end\>"
# Some common markers.
color brightcyan "XXX|TODO|FIXME|\?\?\?"