From 52b2f67e96b4e757e8ff8e1e009dfffd70da91f5 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Tue, 30 Jul 2024 15:43:25 +0300 Subject: [PATCH] Revert StableEditorScroll changes (#224290) Revert "Fixes #216824" This reverts commit f46e9223f6850ba07f0081e177b0e5fe903426fe. --- src/vs/editor/browser/stableEditorScroll.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/vs/editor/browser/stableEditorScroll.ts b/src/vs/editor/browser/stableEditorScroll.ts index 4d7539435cd35..986e18ac6c03d 100644 --- a/src/vs/editor/browser/stableEditorScroll.ts +++ b/src/vs/editor/browser/stableEditorScroll.ts @@ -20,16 +20,6 @@ export class StableEditorScrollState { const visibleRanges = editor.getVisibleRanges(); if (visibleRanges.length > 0) { visiblePosition = visibleRanges[0].getStartPosition(); - - const cursorPos = editor.getPosition(); - if (cursorPos) { - const isVisible = visibleRanges.some(range => range.containsPosition(cursorPos)); - if (isVisible) { - // Keep cursor pos fixed if it is visible - visiblePosition = cursorPos; - } - } - const visiblePositionScrollTop = editor.getTopForPosition(visiblePosition.lineNumber, visiblePosition.column); visiblePositionScrollDelta = editor.getScrollTop() - visiblePositionScrollTop; }