Skip to content

Commit

Permalink
[StickyScrolling] Remove needless job to style sticky lines
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Christopher-Hermann committed Jan 8, 2025
1 parent 650413a commit 690fac0
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 690fac0

Please sign in to comment.