remove remnants of regex_allowed
This commit is contained in:
parent
4bff3166bb
commit
118c80ce89
3 changed files with 8 additions and 8 deletions
|
|
@ -62,19 +62,19 @@ module.exports = {
|
||||||
doc.setMode("./mode/javascript")
|
doc.setMode("./mode/javascript")
|
||||||
|
|
||||||
forceTokenize(doc)
|
forceTokenize(doc)
|
||||||
testStates(doc, ["comment", "start", "start"])
|
testStates(doc, ["comment_regex_allowed", "start", "no_regex"])
|
||||||
|
|
||||||
doc.remove(new Range(0,2,1,2))
|
doc.remove(new Range(0,2,1,2))
|
||||||
testStates(doc, [null, "start"])
|
testStates(doc, [null, "no_regex"])
|
||||||
|
|
||||||
forceTokenize(doc)
|
forceTokenize(doc)
|
||||||
testStates(doc, ["comment", "comment"])
|
testStates(doc, ["comment_regex_allowed", "comment_regex_allowed"])
|
||||||
|
|
||||||
doc.insert({row:0, column:2}, "\n*/")
|
doc.insert({row:0, column:2}, "\n*/")
|
||||||
testStates(doc, [undefined, undefined, "comment"])
|
testStates(doc, [undefined, undefined, "comment_regex_allowed"])
|
||||||
|
|
||||||
forceTokenize(doc)
|
forceTokenize(doc)
|
||||||
testStates(doc, ["comment", "start", "start"])
|
testStates(doc, ["comment_regex_allowed", "start", "no_regex"])
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,13 +91,13 @@ oop.inherits(Mode, TextMode);
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == "start" || state == "regex_allowed") {
|
if (state == "start" || state == "no_regex") {
|
||||||
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
indent += tab;
|
indent += tab;
|
||||||
}
|
}
|
||||||
} else if (state == "doc-start") {
|
} else if (state == "doc-start") {
|
||||||
if (endState == "start" || state == "regex_allowed") {
|
if (endState == "start" || endState == "no_regex") {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
var match = line.match(/^\s*(\/?)\*/);
|
var match = line.match(/^\s*(\/?)\*/);
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ module.exports = {
|
||||||
"test: no auto indent should add to existing indent" : function() {
|
"test: no auto indent should add to existing indent" : function() {
|
||||||
assert.equal(" ", this.mode.getNextLineIndent("start", " if () {", " "));
|
assert.equal(" ", this.mode.getNextLineIndent("start", " if () {", " "));
|
||||||
assert.equal(" ", this.mode.getNextLineIndent("start", " cde", " "));
|
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() {
|
"test: special indent in doc comments" : function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue