do not throw when trying to add intersecting folds
This commit is contained in:
parent
c2ce33f368
commit
2983c4b19f
1 changed files with 6 additions and 7 deletions
|
|
@ -289,13 +289,12 @@ function Folding() {
|
|||
if (startFold && endFold == startFold)
|
||||
return startFold.addSubFold(fold);
|
||||
|
||||
if (
|
||||
(startFold && !startFold.range.isStart(startRow, startColumn))
|
||||
|| (endFold && !endFold.range.isEnd(endRow, endColumn))
|
||||
) {
|
||||
throw new Error("A fold can't intersect already existing fold" + fold.range + startFold.range);
|
||||
}
|
||||
|
||||
if (startFold && !startFold.range.isStart(startRow, startColumn))
|
||||
this.removeFold(startFold);
|
||||
|
||||
if (endFold && !endFold.range.isEnd(endRow, endColumn))
|
||||
this.removeFold(endFold);
|
||||
|
||||
// Check if there are folds in the range we create the new fold for.
|
||||
var folds = this.getFoldsInRange(fold.range);
|
||||
if (folds.length > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue