diff --git a/bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java b/bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java index 34893d66997..c21e2300f2a 100644 --- a/bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java +++ b/bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java @@ -767,6 +767,8 @@ public void setVisibleRegion(int start, int length) { if (document == null) { return; } + int topIndex= redraws() ? getTopIndex() : -1; + setRedraw(false); try { // If the visible region changes, make sure collapsed regions outside of the old visible regions are expanded // and collapse everything outside the new visible region @@ -782,6 +784,8 @@ public void setVisibleRegion(int start, int length) { } catch (BadLocationException e) { ILog log= ILog.of(getClass()); log.log(new Status(IStatus.WARNING, getClass(), IStatus.OK, null, e)); + } finally { + setRedraw(true, topIndex); } }