Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java12
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/VisibleLinesTracker.java7
2 files changed, 6 insertions, 13 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
index 1e41584cc..0f98abf8b 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
@@ -644,15 +644,11 @@ public class LineNumberRulerColumn implements IVerticalRulerColumn {
fCanvas.addMouseMoveListener(fMouseHandler);
fCanvas.addMouseWheelListener(fMouseHandler);
- if (fCachedTextViewer != null) {
- VisibleLinesTracker.track(fCachedTextViewer, lineHeightChangeHandler);
- fCachedTextViewer.addTextListener(fInternalListener);
-
+ fCachedTextViewer.addTextListener(fInternalListener);
- if (fFont == null) {
- if (fCachedTextWidget != null && !fCachedTextWidget.isDisposed())
- fFont= fCachedTextWidget.getFont();
- }
+ if (fFont == null) {
+ if (!fCachedTextWidget.isDisposed())
+ fFont= fCachedTextWidget.getFont();
}
if (fFont != null)
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VisibleLinesTracker.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VisibleLinesTracker.java
index 3f6b38159..4f8c2dfd3 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VisibleLinesTracker.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VisibleLinesTracker.java
@@ -13,8 +13,7 @@
*/
package org.eclipse.jface.text.source;
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.LinkedHashSet;
import java.util.function.Consumer;
import org.eclipse.swt.custom.StyledText;
@@ -48,10 +47,9 @@ class VisibleLinesTracker implements PaintListener {
private int oldBottomPixel;
/**
- *
* List of handler to call when a visible line height change.
*/
- private final Collection<Consumer<StyledText>> handlers;
+ private final LinkedHashSet<Consumer<StyledText>> handlers= new LinkedHashSet<>();
/**
* Constructor to track line height change of visible lines of the {@link StyledText} of the
@@ -61,7 +59,6 @@ class VisibleLinesTracker implements PaintListener {
*/
private VisibleLinesTracker(ITextViewer viewer) {
this.viewer= viewer;
- this.handlers= new ArrayList<>();
}
@Override

Back to the top