mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-108926 - assert: TextRange.<init>
fix another case when invalidated folding region is not removed from group
This commit is contained in:
@@ -723,6 +723,7 @@ public class FoldingModelImpl extends InlayModel.SimpleAdapter
|
||||
FoldRegionImpl otherRegion = getRegion(otherNode);
|
||||
if (otherRegion.mySizeBeforeUpdate > region.mySizeBeforeUpdate) {
|
||||
setNode(region, null);
|
||||
removeRegionFromGroup(region);
|
||||
removeIntervalInternal(0);
|
||||
super.addIntervalsFrom(otherNode);
|
||||
}
|
||||
|
||||
@@ -398,4 +398,18 @@ public class FoldingTest extends AbstractEditorTest {
|
||||
FoldRegion region = addFoldRegion(0, 0, ".");
|
||||
assertNull(region);
|
||||
}
|
||||
|
||||
public void testRegionBecomingInvalidIsRemovedFromGroup() {
|
||||
FoldingGroup group = FoldingGroup.newGroup("test");
|
||||
|
||||
myEditor.getFoldingModel().runBatchFoldingOperation(
|
||||
() -> myModel.createFoldRegion(0, 10, "...", group, false)
|
||||
);
|
||||
addCollapsedFoldRegion(1, 10, "...");
|
||||
|
||||
WriteCommandAction.runWriteCommandAction(getProject(), () -> myEditor.getDocument().deleteString(0, 1));
|
||||
|
||||
List<FoldRegion> regions = myModel.getGroupedRegions(group);
|
||||
assertEmpty(regions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user