From ba08aa628ebe36edcde1458c0d00d9352b54d468 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 29 Sep 2021 09:56:29 +0200 Subject: [PATCH] console: fix command history behavior and increase history size --- CHANGELOG.md | 1 + src/client/ui/ui-console.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69dd790c..2604bac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - sliders: ignore key order in `range` - sliders: handle mousewheel increment when starting from a value between two steps with `steps` property defined - inspector: allow scrolling in the help modal + - console: fix command history behavior and increase history size - widgets - encoder: expose angle in script (as `locals.angle`) diff --git a/src/client/ui/ui-console.js b/src/client/ui/ui-console.js index 44f0bc57..a09b9177 100644 --- a/src/client/ui/ui-console.js +++ b/src/client/ui/ui-console.js @@ -124,9 +124,9 @@ class UiConsole extends UiSidePanel { this.log('output value', returnValue) } - if (this.input.value !== this.history[this.cursor] && this.input.value !== this.history[1]) { + if (this.input.value !== this.history[1]) { this.history.splice(1, 0, this.input.value) - if (this.history.length > 10) this.history.pop() + if (this.history.length > 50) this.history.pop() } this.input.value = ''