ruby multi-line comments

This commit is contained in:
Heigh Tech LLC 2011-02-02 15:05:15 +01:00
commit 67836cc281
2 changed files with 9 additions and 1 deletions

View file

@ -79,7 +79,7 @@ oop.inherits(Mode, TextMode);
return -2; return -2;
} }
else { else {
return doc.indentRows(startRow, endRow, "//"); return doc.indentRows(startRow, endRow, "#");
} }
}; };

View file

@ -74,6 +74,10 @@ RubyHighlightRules = function() {
token : "comment", token : "comment",
regex : "#.*$" regex : "#.*$"
}, { }, {
token : "comment", // multi line comment
regex : "^\=begin$",
next : "comment"
}, {
token : "string.regexp", token : "string.regexp",
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
}, { }, {
@ -135,6 +139,10 @@ RubyHighlightRules = function() {
], ],
"comment" : [ "comment" : [
{ {
token : "comment", // closing comment
regex : "^\=end$",
next : "start"
}, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
regex : ".+" regex : ".+"
} }