From 18d8f36d60bb89ad6bcb06370eb4e51803083034 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 23 Apr 2021 13:59:13 +0200 Subject: [PATCH] console: don't insert whitespaces on tab keydown if input is empty --- src/client/ui/ui-console.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/ui/ui-console.js b/src/client/ui/ui-console.js index ad27506f..9fac72d2 100644 --- a/src/client/ui/ui-console.js +++ b/src/client/ui/ui-console.js @@ -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)