This commit is contained in:
Fabian Jakobs 2011-12-19 13:22:23 +01:00
commit 63e037f544
17 changed files with 75 additions and 60 deletions

View file

@ -368,7 +368,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -380,8 +380,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}