mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correct order of operations on bulk update finishing
This commit is contained in:
@@ -1848,16 +1848,16 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
private void bulkUpdateFinished() {
|
||||
myFoldingModel.onBulkDocumentUpdateFinished();
|
||||
mySoftWrapModel.onBulkDocumentUpdateFinished();
|
||||
if (myUseNewRendering) {
|
||||
myView.reset();
|
||||
}
|
||||
myCaretModel.onBulkDocumentUpdateFinished();
|
||||
|
||||
clearTextWidthCache();
|
||||
|
||||
setMouseSelectionState(MOUSE_SELECTION_STATE_NONE);
|
||||
|
||||
if (myUseNewRendering) {
|
||||
myView.reset();
|
||||
}
|
||||
else {
|
||||
if (!myUseNewRendering) {
|
||||
mySizeContainer.reset();
|
||||
}
|
||||
validateSize();
|
||||
|
||||
@@ -214,4 +214,13 @@ public class EditorImplTest extends AbstractEditorTest {
|
||||
myEditor.getSettings().setUseSoftWraps(false);
|
||||
assertEquals(new Dimension(70, 10), myEditor.getContentComponent().getPreferredSize());
|
||||
}
|
||||
|
||||
public void testUpdatingCaretPositionAfterBulkMode() throws Exception {
|
||||
initText("a<caret>bc");
|
||||
DocumentEx document = (DocumentEx)myEditor.getDocument();
|
||||
document.setInBulkUpdate(true);
|
||||
document.insertString(0, "\n "); // we're changing number of visual lines, and invalidating text layout for caret line
|
||||
document.setInBulkUpdate(false);
|
||||
checkResultByText("\n a<caret>bc");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user