fixed ruby comment RegExps
This commit is contained in:
parent
54507f44e7
commit
d291e0aa68
2 changed files with 5 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue