From 0c8d2abf55eb4c4623ec8bfcf8cb632649ccd7dd 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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..b1a5c5b2d07 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2025 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -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); } }