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) {
|
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
||||||
var outdent = true;
|
var outdent = true;
|
||||||
var outentedRows = [];
|
var outentedRows = [];
|
||||||
var re = /^(\s*)\/\//;
|
var re = /^(\s*)#/;
|
||||||
|
|
||||||
for (var i=startRow; i<= endRow; i++) {
|
for (var i=startRow; i<= endRow; i++) {
|
||||||
if (!re.test(doc.getLine(i))) {
|
if (!re.test(doc.getLine(i))) {
|
||||||
|
|
@ -95,7 +95,7 @@ oop.inherits(Mode, TextMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == "start") {
|
if (state == "start") {
|
||||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
var match = line.match(/^.*[\{\(\[\:]\s*$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
indent += tab;
|
indent += tab;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,12 +65,12 @@ RubyHighlightRules = function() {
|
||||||
"start" : [
|
"start" : [
|
||||||
{
|
{
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "/#.*$/"
|
regex : "#.*$"
|
||||||
},
|
},
|
||||||
docComment.getStartRule("doc-start"),
|
docComment.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
regex : "/^\=begin$/",
|
regex : "^\=begin$",
|
||||||
next : "comment"
|
next : "comment"
|
||||||
}, {
|
}, {
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
|
|
@ -133,7 +133,7 @@ RubyHighlightRules = function() {
|
||||||
"comment" : [
|
"comment" : [
|
||||||
{
|
{
|
||||||
token : "comment", // closing comment
|
token : "comment", // closing comment
|
||||||
regex : "/^\=end$/",
|
regex : "^\=end$",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment", // comment spanning whole line
|
token : "comment", // comment spanning whole line
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue