From cca8fd84f27f348870f1c8a661a7ce8d394361a3 Mon Sep 17 00:00:00 2001 From: Fred Sauer Date: Sun, 22 Mar 2026 10:07:58 -0700 Subject: [PATCH 1/2] Avoid unnecessary refreshDebugState Skip unnecessary clearCurrentLine and setCurrentLine every tick when current PC marker does not need to be updated, which in turn avoid unnecessary EditorView.updateListener invocations every tick. --- src/ide/views/editors.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ide/views/editors.ts b/src/ide/views/editors.ts index cecd5394..64db0aad 100644 --- a/src/ide/views/editors.ts +++ b/src/ide/views/editors.ts @@ -536,10 +536,13 @@ export class SourceEditor implements ProjectView { } refreshDebugState(moveCursor: boolean) { - // TODO: only if line changed + var line = this.getActiveLine(); + if (!line && !this.currentDebugLine && !moveCursor) { + return; + } + // TODO: remove after compilation this.clearCurrentLine(moveCursor); - var line = this.getActiveLine(); if (line) { this.setCurrentLine(line, moveCursor); } From 08072b9ca08b5341d617c5a2646df89d5760714e Mon Sep 17 00:00:00 2001 From: Fred Sauer Date: Sun, 22 Mar 2026 10:13:58 -0700 Subject: [PATCH 2/2] Delete redundant clearCurrentLine Remove clearCurrentLine and conditional check from refreshDebugState as the same functionality is duplicated in setCurrenLine. --- src/ide/views/editors.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ide/views/editors.ts b/src/ide/views/editors.ts index 64db0aad..2f241331 100644 --- a/src/ide/views/editors.ts +++ b/src/ide/views/editors.ts @@ -541,11 +541,7 @@ export class SourceEditor implements ProjectView { return; } - // TODO: remove after compilation - this.clearCurrentLine(moveCursor); - if (line) { - this.setCurrentLine(line, moveCursor); - } + this.setCurrentLine(line, moveCursor); } refreshListing() {