From bac8d3df8f433a49624fe1bd3d59afcf70c7812b Mon Sep 17 00:00:00 2001 From: danthe1st Date: Sun, 26 Oct 2025 11:31:12 +0100 Subject: [PATCH] disable redrawing when setting visible region to prevent flickering --- .../jface/text/source/projection/ProjectionViewer.java | 4 ++++ 1 file changed, 4 insertions(+) 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); } }