Skip to content

Commit bac8d3d

Browse files
committed
disable redrawing when setting visible region to prevent flickering
1 parent 3a441d9 commit bac8d3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ public void setVisibleRegion(int start, int length) {
767767
if (document == null) {
768768
return;
769769
}
770+
int topIndex= redraws() ? getTopIndex() : -1;
771+
setRedraw(false);
770772
try {
771773
// If the visible region changes, make sure collapsed regions outside of the old visible regions are expanded
772774
// and collapse everything outside the new visible region
@@ -782,6 +784,8 @@ public void setVisibleRegion(int start, int length) {
782784
} catch (BadLocationException e) {
783785
ILog log= ILog.of(getClass());
784786
log.log(new Status(IStatus.WARNING, getClass(), IStatus.OK, null, e));
787+
} finally {
788+
setRedraw(true, topIndex);
785789
}
786790
}
787791

0 commit comments

Comments
 (0)