Skip to content

Commit f48db31

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 eaf2db1 commit f48db31

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
@@ -517,10 +517,13 @@ export class SourceEditor implements ProjectView {
517517
}
518518

519519
refreshDebugState(moveCursor: boolean) {
520-
// TODO: only if line changed
520+
var line = this.getActiveLine();
521+
if (!line && !this.currentDebugLine && !moveCursor) {
522+
return;
523+
}
524+
521525
// TODO: remove after compilation
522526
this.clearCurrentLine(moveCursor);
523-
var line = this.getActiveLine();
524527
if (line) {
525528
this.setCurrentLine(line, moveCursor);
526529
}

0 commit comments

Comments
 (0)