From 9df3996559a1108f77bc663aea4f18261ffa41c0 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 14 Sep 2021 20:51:34 +0100 Subject: [PATCH] fixed command line not staying in single mode --- src/js/commandline.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/js/commandline.js b/src/js/commandline.js index 065286a9e..b921f8502 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -527,13 +527,20 @@ $(document).keydown((e) => { return; } } - if ( - e.key === "Backspace" && - $("#commandLine input").val()[0] == ">" && - Config.singleListCommandLine == "manual" && - isSingleListCommandLineActive() - ) - restoreOldCommandLine(false); + + if (e.key === "Backspace") { + setTimeout(() => { + let inputVal = $("#commandLine input").val(); + if ( + Config.singleListCommandLine == "manual" && + isSingleListCommandLineActive() && + inputVal[0] !== ">" + ) { + restoreOldCommandLine(); + } + }, 1); + } + if (e.key === "Enter") { //enter e.preventDefault();