fixed ruby comment RegExps

This commit is contained in:
Heigh Tech LLC 2011-01-30 16:47:02 +01:00
commit d291e0aa68
2 changed files with 5 additions and 5 deletions

View file

@ -57,7 +57,7 @@ oop.inherits(Mode, TextMode);
this.toggleCommentLines = function(state, doc, startRow, endRow) {
var outdent = true;
var outentedRows = [];
var re = /^(\s*)\/\//;
var re = /^(\s*)#/;
for (var i=startRow; i<= endRow; i++) {
if (!re.test(doc.getLine(i))) {
@ -95,7 +95,7 @@ oop.inherits(Mode, TextMode);
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/);
var match = line.match(/^.*[\{\(\[\:]\s*$/);
if (match) {
indent += tab;
}

View file

@ -65,12 +65,12 @@ RubyHighlightRules = function() {
"start" : [
{
token : "comment",
regex : "/#.*$/"
regex : "#.*$"
},
docComment.getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "/^\=begin$/",
regex : "^\=begin$",
next : "comment"
}, {
token : "string.regexp",
@ -133,7 +133,7 @@ RubyHighlightRules = function() {
"comment" : [
{
token : "comment", // closing comment
regex : "/^\=end$/",
regex : "^\=end$",
next : "start"
}, {
token : "comment", // comment spanning whole line