Skip to content

Commit cca8fd8

Browse files
committed
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.
1 parent 6ce80f9 commit cca8fd8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ide/views/editors.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,13 @@ export class SourceEditor implements ProjectView {
536536
}
537537

538538
refreshDebugState(moveCursor: boolean) {
539-
// TODO: only if line changed
539+
var line = this.getActiveLine();
540+
if (!line && !this.currentDebugLine && !moveCursor) {
541+
return;
542+
}
543+
540544
// TODO: remove after compilation
541545
this.clearCurrentLine(moveCursor);
542-
var line = this.getActiveLine();
543546
if (line) {
544547
this.setCurrentLine(line, moveCursor);
545548
}

0 commit comments

Comments
 (0)