Skip to content

Commit 4f15c45

Browse files
committed
disable redrawing when setting visible region to prevent flickering
1 parent ce17c9e commit 4f15c45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ public void setVisibleRegion(int start, int length) {
768768
return;
769769
}
770770
try {
771+
setRedraw(false);
771772
// If the visible region changes, make sure collapsed regions outside of the old visible regions are expanded
772773
// and collapse everything outside the new visible region
773774
int end= computeEndOfVisibleRegion(start, length, document);
@@ -780,6 +781,8 @@ public void setVisibleRegion(int start, int length) {
780781
} catch (BadLocationException e) {
781782
ILog log= ILog.of(getClass());
782783
log.log(new Status(IStatus.WARNING, getClass(), IStatus.OK, null, e));
784+
} finally {
785+
setRedraw(true);
783786
}
784787
}
785788

0 commit comments

Comments
 (0)