mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable document changes during batch folding update and add bounds-checking assertions to EditorSizeManager (to prevent EA-82327)
This commit is contained in:
@@ -561,6 +561,7 @@ public class FoldingModelImpl implements FoldingModelEx, PrioritizedInternalDocu
|
||||
|
||||
@Override
|
||||
public void beforeDocumentChange(DocumentEvent event) {
|
||||
if (myIsBatchFoldingProcessing) LOG.error("Document changes are not allowed during batch folding update");
|
||||
myDocumentChangeProcessed = false;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -378,6 +378,8 @@ class EditorSizeManager extends InlayModel.SimpleAdapter implements PrioritizedD
|
||||
}
|
||||
|
||||
void textLayoutPerformed(int startOffset, int endOffset) {
|
||||
assert 0 <= startOffset && startOffset < endOffset && endOffset <= myDocument.getTextLength()
|
||||
: "startOffset=" + startOffset + ", endOffset=" + endOffset;
|
||||
if (myDocument.isInBulkUpdate()) return;
|
||||
if (myEditor.getFoldingModel().isInBatchFoldingOperation()) {
|
||||
myDeferredRanges.add(new TextRange(startOffset, endOffset));
|
||||
|
||||
Reference in New Issue
Block a user