From 9515786e802f59563010d395caa90260bb65e95b Mon Sep 17 00:00:00 2001 From: Mickael Istria Date: Wed, 29 Mar 2023 17:15:54 +0200 Subject: [PATCH] Call getLineCount in UI Thread Fixes https://github.com/eclipse-platform/eclipse.platform.text/issues/172 --- .../jface/text/source/AnnotationRulerColumn.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java index 106a6fb1b..57fed27d8 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java @@ -191,10 +191,12 @@ public int compare(Tuple o1, Tuple o2) { @Override public void textChanged(TextEvent event) { - if (event.getViewerRedrawState() && fCachedTextWidget.getLineCount() != previousLineCount) { - previousLineCount= fCachedTextWidget.getLineCount(); - postRedraw(); - } + fCachedTextWidget.getDisplay().execute(() -> { + if (event.getViewerRedrawState() && fCachedTextWidget.getLineCount() != previousLineCount) { + previousLineCount= fCachedTextWidget.getLineCount(); + postRedraw(); + } + }); } };