Skip to content

Commit

Permalink
[StickyScrolling] Don't style outdated sticky lines
Browse files Browse the repository at this point in the history
The search view with "reuse editor" enabled sets new source code in the existing editor and fires a extPresentation change event. In this call, it can happen that the sticky line number exceeds the amount of line in the new source code. In general this is not a problem since the sticky lines will be recalculated afterwards, but to avoid IllegalArgumentException it is checked for this case.

Fixes eclipse-platform#2678
  • Loading branch information
Christopher-Hermann authored and iloveeclipse committed Jan 17, 2025
1 parent dbf808e commit 2fc9366
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ private void addSourceViewerListeners() {
if (sourceViewer instanceof ITextViewerExtension4 extension) {
textPresentationListener = e -> {
Display.getDefault().asyncExec(() -> {
if (areStickyLinesOutDated(textWidget)) {
return;
}
styleStickyLines();
});
};
Expand Down

0 comments on commit 2fc9366

Please sign in to comment.