Skip to content

Commit 4d07cda

Browse files
committed
fix: avoid aggressive scrolling when navigating markers
When navigating to the next/prev problem using editor.action.marker.next, the editor would always scroll the marker to the top of the viewport (using revealPositionNearTop), even if the marker was already visible or just slightly off-screen. This caused a "jumpy" experience and confusion. Changed to use revealPositionInCenterIfOutsideViewport, which maintains context by only scrolling if necessary, and centers the marker if it is significantly far away. Fixes #156782
1 parent 4e6a50e commit 4d07cda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
358358
}
359359
this._icon.className = `codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(this._severity))}`;
360360

361-
this.editor.revealPositionNearTop(position, ScrollType.Smooth);
361+
this.editor.revealPositionInCenterIfOutsideViewport(position, ScrollType.Smooth);
362362
this.editor.focus();
363363
}
364364

0 commit comments

Comments
 (0)