fixed exception in xml folding when tags are not balanced
This commit is contained in:
parent
a424fb5da5
commit
41d8cfa4ef
1 changed files with 5 additions and 6 deletions
|
|
@ -217,13 +217,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 == 0)
|
||||||
break;
|
return Range.fromPoints(start, tag.start);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
stack.push(tag)
|
stack.push(tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Range.fromPoints(start, tag.start);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
|
var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
|
||||||
|
|
@ -244,15 +243,15 @@ 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 == 0) {
|
||||||
break;
|
tag.start.column += tag.tagName.length + 2;
|
||||||
|
return Range.fromPoints(tag.start, end);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
stack.push(tag)
|
stack.push(tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tag.start.column += tag.tagName.length + 2;
|
|
||||||
return Range.fromPoints(tag.start, end);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue