From 665d3dc13386c8311c9a88c7a493a0175e31ac70 Mon Sep 17 00:00:00 2001 From: Christopher Hermann Date: Wed, 8 Jan 2025 09:23:56 +0100 Subject: [PATCH] [StickyScrolling] Remove needless job to style sticky lines The styling is done in another Thread by asyncExe anyways, there is no need to do this in an Job. This overhead can be avoided. --- .../stickyscroll/StickyScrollingControl.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingControl.java b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingControl.java index 7375afadfc4..289f4d2caf4 100644 --- a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingControl.java +++ b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingControl.java @@ -41,9 +41,6 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.core.runtime.ICoreRunnable; -import org.eclipse.core.runtime.jobs.Job; - import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -395,12 +392,10 @@ private void addSourceViewerListeners() { StyledText textWidget= sourceViewer.getTextWidget(); if (sourceViewer instanceof ITextViewerExtension4 extension) { - textPresentationListener= e -> { - Job.create("Update sticky lines styling", (ICoreRunnable) monitor -> { //$NON-NLS-1$ - Display.getDefault().asyncExec(() -> { - styleStickyLines(); - }); - }).schedule(); + textPresentationListener = e -> { + Display.getDefault().asyncExec(() -> { + styleStickyLines(); + }); }; extension.addTextPresentationListener(textPresentationListener); }