Skip to content

Commit

Permalink
Make console always scroll to bottom on updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
szschaler authored Nov 29, 2023
1 parent 06d92de commit 2abd874
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions platform/src/ConsolePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ class ConsolePanel extends Panel {
this.setTitleAndIcon("Console", "console");
}

setValue(value) {
this.setOutput(value+"");
}

setOutput(str) {
document.getElementById(this.id + "Editor").style.color = "black";
let element = document.getElementById(this.id + "Editor");
element.style.color = "black";
this.editor.getSession().setUseWrapMode(false);
this.editor.setValue(str, 1);

// Scroll to the bottom. This works because we're really still using an ACE editor even in the console panel.
this.editor.renderer.scrollToLine(Number.POSITIVE_INFINITY);
}

setError(str) {
Expand Down

0 comments on commit 2abd874

Please sign in to comment.