remove remnants of regex_allowed

This commit is contained in:
nightwing 2013-02-13 00:52:10 +04:00
commit 118c80ce89
3 changed files with 8 additions and 8 deletions

View file

@ -62,19 +62,19 @@ module.exports = {
doc.setMode("./mode/javascript")
forceTokenize(doc)
testStates(doc, ["comment", "start", "start"])
testStates(doc, ["comment_regex_allowed", "start", "no_regex"])
doc.remove(new Range(0,2,1,2))
testStates(doc, [null, "start"])
testStates(doc, [null, "no_regex"])
forceTokenize(doc)
testStates(doc, ["comment", "comment"])
testStates(doc, ["comment_regex_allowed", "comment_regex_allowed"])
doc.insert({row:0, column:2}, "\n*/")
testStates(doc, [undefined, undefined, "comment"])
testStates(doc, [undefined, undefined, "comment_regex_allowed"])
forceTokenize(doc)
testStates(doc, ["comment", "start", "start"])
testStates(doc, ["comment_regex_allowed", "start", "no_regex"])
}
};

View file

@ -91,13 +91,13 @@ oop.inherits(Mode, TextMode);
return indent;
}
if (state == "start" || state == "regex_allowed") {
if (state == "start" || state == "no_regex") {
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
if (match) {
indent += tab;
}
} else if (state == "doc-start") {
if (endState == "start" || state == "regex_allowed") {
if (endState == "start" || endState == "no_regex") {
return "";
}
var match = line.match(/^\s*(\/?)\*/);

View file

@ -115,7 +115,7 @@ module.exports = {
"test: no auto indent should add to existing indent" : function() {
assert.equal(" ", this.mode.getNextLineIndent("start", " if () {", " "));
assert.equal(" ", this.mode.getNextLineIndent("start", " cde", " "));
assert.equal(" ", this.mode.getNextLineIndent("regex_allowed", "function foo(items) {", " "));
assert.equal(" ", this.mode.getNextLineIndent("start", "function foo(items) {", " "));
},
"test: special indent in doc comments" : function() {