fix regression which broke js auto indent
This commit is contained in:
parent
0c956185e3
commit
092839224f
2 changed files with 3 additions and 2 deletions
|
|
@ -95,13 +95,13 @@ oop.inherits(Mode, TextMode);
|
|||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start") {
|
||||
if (state == "start" || state == "regex_allowed") {
|
||||
var match = line.match(/^.*[\{\(\[\:]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
} else if (state == "doc-start") {
|
||||
if (endState == "start") {
|
||||
if (endState == "start" || state == "regex_allowed") {
|
||||
return "";
|
||||
}
|
||||
var match = line.match(/^\s*(\/?)\*/);
|
||||
|
|
|
|||
|
|
@ -117,6 +117,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) {", " "));
|
||||
},
|
||||
|
||||
"test: special indent in doc comments" : function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue