This commit is contained in:
Fabian Jakobs 2011-07-22 13:19:21 +02:00
commit eae645cb00
2 changed files with 11 additions and 7 deletions

View file

@ -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;
} }

View file

@ -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", " "));