From 6496eea554a611471366b7e69134eb6f3ff96893 Mon Sep 17 00:00:00 2001 From: Andreas Koch Date: Thu, 31 Oct 2024 15:41:38 +0100 Subject: [PATCH] Refresh LineNumberRulerColumn on ZoomChange of canvas This commit adds a listener for the ZoomChanged event to the canvas of a LineNumberRulerColumn. If the listener is notified of this event this means, that state, that differs over different zoom values, must be recalculated. Therefore the indentation are reset, when the event occurs. Contributes to eclipse-platform/eclipse.platform.swt#62 and eclipse-platform/eclipse.platform.swt#131 --- .../org/eclipse/jface/text/source/LineNumberRulerColumn.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java index 6bf9a3ca6d0..7eff2aee8f0 100644 --- a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java +++ b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java @@ -616,6 +616,8 @@ public void addMouseListener(MouseListener listener) { fCachedTextWidget= null; }); + fCanvas.addListener(SWT.ZoomChanged, e -> computeIndentations()); + fMouseHandler= new MouseHandler(); fCanvas.addMouseListener(fMouseHandler); fCanvas.addMouseMoveListener(fMouseHandler);