IDEA-135620 Typing with a lot of carets (hundreds) is extremely slow

some 'cheap' improvements
This commit is contained in:
Dmitry Batrak
2016-08-31 17:45:48 +03:00
parent acb8b0843b
commit 7dab2a75d8
2 changed files with 4 additions and 7 deletions
@@ -493,7 +493,7 @@ public class CaretImpl extends UserDataHolderBase implements Caret, Dumpable {
}
}
myEditor.getFoldingModel().flushCaretPosition();
myEditor.getFoldingModel().flushCaretPosition(this);
VerticalInfo oldInfo = myCaretInfo;
LogicalPosition oldCaretPosition = myLogicalCaret;
@@ -682,7 +682,7 @@ public class CaretImpl extends UserDataHolderBase implements Caret, Dumpable {
updateVisualLineInfo();
myEditor.getFoldingModel().flushCaretPosition();
myEditor.getFoldingModel().flushCaretPosition(this);
setLastColumnNumber(myLogicalCaret.column);
myDesiredSelectionStartColumn = myDesiredSelectionEndColumn = -1;
@@ -872,7 +872,6 @@ public class CaretImpl extends UserDataHolderBase implements Caret, Dumpable {
}
}
updateVisualLineInfo();
updateSelectionOnDocumentChange();
}
@@ -523,10 +523,8 @@ public class FoldingModelImpl implements FoldingModelEx, PrioritizedInternalDocu
return myFoldTextAttributes;
}
public void flushCaretPosition() {
for (Caret caret : myEditor.getCaretModel().getAllCarets()) {
caret.putUserData(SAVED_CARET_POSITION, null);
}
void flushCaretPosition(@NotNull Caret caret) {
caret.putUserData(SAVED_CARET_POSITION, null);
}
void onBulkDocumentUpdateStarted() {