console: fix command history behavior and increase history size

This commit is contained in:
jean-emmanuel 2021-09-29 09:56:29 +02:00
parent 241f36d499
commit ba08aa628e
2 changed files with 3 additions and 2 deletions

View file

@ -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`)

View file

@ -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 = ''