This commit is contained in:
Daniel Kluge 2022-01-16 16:13:38 +01:00
parent 858cffb587
commit caa9442575

View File

@ -75,7 +75,8 @@ const REPLInput: NextPage<REPLInputParams> = ({historyCallback, historyClear, in
e.preventDefault(); e.preventDefault();
} }
if (e.key === "Tab" && currentCmd.length !== 0) { 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); setJustTabbed(justTabbed + 1);
return false; return false;
} else setJustTabbed(0); } else setJustTabbed(0);