From caa9442575beb9edbf7235c7a8d23cb08bed5fb9 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Sun, 16 Jan 2022 16:13:38 +0100 Subject: [PATCH] Fix #8 --- components/REPL/REPLInput.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/REPL/REPLInput.tsx b/components/REPL/REPLInput.tsx index 6cdf714..4e7c74c 100644 --- a/components/REPL/REPLInput.tsx +++ b/components/REPL/REPLInput.tsx @@ -75,7 +75,8 @@ const REPLInput: NextPage = ({historyCallback, historyClear, in e.preventDefault(); } if (e.key === "Tab" && currentCmd.length !== 0) { - setInput(input, currentCmd[justTabbed % currentCmd.length]); + const cmd = `${currentCmd[justTabbed % currentCmd.length]}${currentCmd.length === 1 ? " " : ""}`; + setInput(input, cmd); setJustTabbed(justTabbed + 1); return false; } else setJustTabbed(0);