From 7e0011223ee06efcbc745f42ee9a6ccc413d4cf3 Mon Sep 17 00:00:00 2001 From: Fred Sauer Date: Sat, 11 Apr 2026 10:29:21 -0700 Subject: [PATCH] Fix unwanted scroll on window blur Prevent unwanted viewport scroll in setCurrentLine when the tab loses focus. Only call scrollIntoView when moveCursor is true. --- src/ide/views/editors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ide/views/editors.ts b/src/ide/views/editors.ts index cecd5394..d7620a8b 100644 --- a/src/ide/views/editors.ts +++ b/src/ide/views/editors.ts @@ -480,8 +480,8 @@ export class SourceEditor implements ProjectView { effects: [ currentPcMarker.set.of(line.line), currentPc.effect.of(line.line), - // Optional: follow the execution point - EditorView.scrollIntoView(this.editor.state.doc.line(line.line).from, { y: "center" }), + // Follow the execution point when stepping/hitting breakpoints. + ...(moveCursor ? [EditorView.scrollIntoView(this.editor.state.doc.line(line.line).from, { y: "center" })] : []), ] }); }