fix #161
This commit is contained in:
parent
94bd4171d9
commit
eae645cb00
2 changed files with 11 additions and 7 deletions
|
|
@ -96,7 +96,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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,10 @@ module.exports = {
|
||||||
assert.equal(" ", this.mode.getNextLineIndent("start", "if () {", " "));
|
assert.equal(" ", this.mode.getNextLineIndent("start", "if () {", " "));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"test: auto indent after case" : function() {
|
||||||
|
assert.equal(" ", this.mode.getNextLineIndent("start", "case 'juhu':", " "));
|
||||||
|
},
|
||||||
|
|
||||||
"test: no auto indent after opening brace in multi line comment" : function() {
|
"test: no auto indent after opening brace in multi line comment" : function() {
|
||||||
assert.equal("", this.mode.getNextLineIndent("start", "/*if () {", " "));
|
assert.equal("", this.mode.getNextLineIndent("start", "/*if () {", " "));
|
||||||
assert.equal(" ", this.mode.getNextLineIndent("comment", " abcd", " "));
|
assert.equal(" ", this.mode.getNextLineIndent("comment", " abcd", " "));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue