Small fix in audo-indentation.

This commit is contained in:
Eddy Bruel 2010-11-02 15:14:38 +01:00
commit e02afd9806
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ var Document = function(text, mode) {
if (mode) { if (mode) {
this.setMode(mode); this.setMode(mode);
} }
if (lang.isArray(text)) { if (lang.isArray(text)) {
this.$insertLines(0, text); this.$insertLines(0, text);
} else { } else {

View file

@ -423,7 +423,7 @@ var Editor = function(renderer, doc) {
else else
break; break;
console.log("Indent " + indent + "(" + line.length + ")"); console.log("Indent " + indent + "(" + line.length + ")");
if (line.length != 0) if (/[^\s]$/.test(line))
minIndent = Math.min(indent, minIndent); minIndent = Math.min(indent, minIndent);
} }
console.log("min indent " + minIndent); console.log("min indent " + minIndent);