Skip to content

Commit 690fac0

Browse files
[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.
1 parent 650413a commit 690fac0

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingControl.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
import org.eclipse.swt.widgets.Listener;
4242
import org.eclipse.swt.widgets.ScrollBar;
4343

44-
import org.eclipse.core.runtime.ICoreRunnable;
45-
import org.eclipse.core.runtime.jobs.Job;
46-
4744
import org.eclipse.jface.layout.GridDataFactory;
4845
import org.eclipse.jface.layout.GridLayoutFactory;
4946

@@ -395,12 +392,10 @@ private void addSourceViewerListeners() {
395392
StyledText textWidget= sourceViewer.getTextWidget();
396393

397394
if (sourceViewer instanceof ITextViewerExtension4 extension) {
398-
textPresentationListener= e -> {
399-
Job.create("Update sticky lines styling", (ICoreRunnable) monitor -> { //$NON-NLS-1$
400-
Display.getDefault().asyncExec(() -> {
401-
styleStickyLines();
402-
});
403-
}).schedule();
395+
textPresentationListener = e -> {
396+
Display.getDefault().asyncExec(() -> {
397+
styleStickyLines();
398+
});
404399
};
405400
extension.addTextPresentationListener(textPresentationListener);
406401
}

0 commit comments

Comments
 (0)