--- a/editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java Wed Feb 22 06:03:52 2017 +0000 +++ b/editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java Sat Feb 25 02:34:05 2017 +0000 @@ -1648,7 +1648,14 @@ caretFoldExpander.checkExpandFolds(c, expandFoldPositions); } } - if (activeTransaction.isDotOrStructuralChange()) { + /* 269451: If we set scrollToLastCaret above, we need to let dispatchUpdate + happen so the former can be cleared again. A comment in + CaretTransaction suggests that scrolling really should happen + even if the dot offset is not changed. ("Scroll even if setDot() + to same offset"). */ + if (activeTransaction.isDotOrStructuralChange() || + activeTransaction.isScrollToLastCaret()) + { if (!inAtomicSectionL) { // For now clear the lists and use old way TODO update to selective updating and rendering fireStateChanged(activeTransaction.getOrigin());