console: don't insert whitespaces on tab keydown if input is empty

This commit is contained in:
jean-emmanuel 2021-04-23 13:59:13 +02:00
parent 81ef063c9a
commit 18d8f36d60

View file

@ -83,7 +83,7 @@ class UiConsole extends UiSidePanel {
this.input.value = this.history[this.cursor]
event.preventDefault()
}
} else if (event.keyCode === 9) {
} else if (event.keyCode === 9 && this.input.value !== '') {
var cur = this.input.selectionStart,
val = this.input.value
this.input.value = val.slice(0, cur) + ' ' + val.slice(cur)