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) {
|
||||
this._pop(stack, tag);
|
||||
if (stack.length == 0)
|
||||
break;
|
||||
return Range.fromPoints(start, tag.start);
|
||||
}
|
||||
else {
|
||||
stack.push(tag)
|
||||
}
|
||||
}
|
||||
return Range.fromPoints(start, tag.start);
|
||||
}
|
||||
else {
|
||||
var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
|
||||
|
|
@ -244,15 +243,15 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
if (!tag.closing) {
|
||||
this._pop(stack, tag);
|
||||
if (stack.length == 0)
|
||||
break;
|
||||
if (stack.length == 0) {
|
||||
tag.start.column += tag.tagName.length + 2;
|
||||
return Range.fromPoints(tag.start, end);
|
||||
}
|
||||
}
|
||||
else {
|
||||
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