do not include tag attributes in the fold
This commit is contained in:
parent
127270a7aa
commit
10a759feb7
1 changed files with 14 additions and 10 deletions
|
|
@ -113,7 +113,7 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
};
|
||||
}
|
||||
value += token.value;
|
||||
if (value.indexOf(">") !== -1) {
|
||||
if (token.type.slice(-4) === ".end") {
|
||||
var tag = this._parseTag(value);
|
||||
tag.start = start;
|
||||
tag.end = {
|
||||
|
|
@ -195,7 +195,7 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
var iterator = new TokenIterator(session, row, firstTag.column);
|
||||
var start = {
|
||||
row: row,
|
||||
column: firstTag.column + firstTag.tagName.length + 2
|
||||
column: firstTag.column + firstTag.match.length
|
||||
};
|
||||
while (tag = this._readTagForward(iterator)) {
|
||||
if (tag.selfClosing) {
|
||||
|
|
@ -209,8 +209,9 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
if (tag.closing) {
|
||||
this._pop(stack, tag);
|
||||
if (stack.length == 0)
|
||||
if (!stack.length)
|
||||
return Range.fromPoints(start, tag.start);
|
||||
|
||||
}
|
||||
else {
|
||||
stack.push(tag)
|
||||
|
|
@ -236,9 +237,12 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
if (!tag.closing) {
|
||||
this._pop(stack, tag);
|
||||
if (stack.length == 0) {
|
||||
tag.start.column += tag.tagName.length + 2;
|
||||
return Range.fromPoints(tag.start, end);
|
||||
if (!stack.length) {
|
||||
if (tag.start.row != tag.end.row) {
|
||||
tag.end = tag.start;
|
||||
tag.end.column += session.getLine(tag.end.row).length;
|
||||
}
|
||||
return Range.fromPoints(tag.end, end);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -249,6 +253,6 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue