From 4d07cda5059fce643083899c18cddbb831cf1118 Mon Sep 17 00:00:00 2001 From: Murat Aslan Date: Fri, 2 Jan 2026 11:10:20 +0300 Subject: [PATCH] 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 --- src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts b/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts index 3d2538512e75..b8394a1e72c6 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts @@ -358,7 +358,7 @@ export class MarkerNavigationWidget extends PeekViewWidget { } this._icon.className = `codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(this._severity))}`; - this.editor.revealPositionNearTop(position, ScrollType.Smooth); + this.editor.revealPositionInCenterIfOutsideViewport(position, ScrollType.Smooth); this.editor.focus(); }