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;
|
value += token.value;
|
||||||
if (value.indexOf(">") !== -1) {
|
if (token.type.slice(-4) === ".end") {
|
||||||
var tag = this._parseTag(value);
|
var tag = this._parseTag(value);
|
||||||
tag.start = start;
|
tag.start = start;
|
||||||
tag.end = {
|
tag.end = {
|
||||||
|
|
@ -195,7 +195,7 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||||
var iterator = new TokenIterator(session, row, firstTag.column);
|
var iterator = new TokenIterator(session, row, firstTag.column);
|
||||||
var start = {
|
var start = {
|
||||||
row: row,
|
row: row,
|
||||||
column: firstTag.column + firstTag.tagName.length + 2
|
column: firstTag.column + firstTag.match.length
|
||||||
};
|
};
|
||||||
while (tag = this._readTagForward(iterator)) {
|
while (tag = this._readTagForward(iterator)) {
|
||||||
if (tag.selfClosing) {
|
if (tag.selfClosing) {
|
||||||
|
|
@ -209,8 +209,9 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||||
|
|
||||||
if (tag.closing) {
|
if (tag.closing) {
|
||||||
this._pop(stack, tag);
|
this._pop(stack, tag);
|
||||||
if (stack.length == 0)
|
if (!stack.length)
|
||||||
return Range.fromPoints(start, tag.start);
|
return Range.fromPoints(start, tag.start);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
stack.push(tag)
|
stack.push(tag)
|
||||||
|
|
@ -236,9 +237,12 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||||
|
|
||||||
if (!tag.closing) {
|
if (!tag.closing) {
|
||||||
this._pop(stack, tag);
|
this._pop(stack, tag);
|
||||||
if (stack.length == 0) {
|
if (!stack.length) {
|
||||||
tag.start.column += tag.tagName.length + 2;
|
if (tag.start.row != tag.end.row) {
|
||||||
return Range.fromPoints(tag.start, end);
|
tag.end = tag.start;
|
||||||
|
tag.end.column += session.getLine(tag.end.row).length;
|
||||||
|
}
|
||||||
|
return Range.fromPoints(tag.end, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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