Buffer page keys only for commands that open and focus the cmdline

This commit is contained in:
petoncle 2023-12-16 18:41:15 +01:00
parent ba977dc6ba
commit ac7d7e577b
2 changed files with 2 additions and 2 deletions

View file

@ -172,7 +172,7 @@ export function focus() {
logger.debug("Consuming buffered page keys", bufferedPageKeys,
"initialClInputValue = " + initialClInputValue,
"currentClInputValue = " + currentClInputValue);
// Native events are assumed to be character keydowns events,
// Native events are assumed to be character keydown events,
// i.e. characters appended at the end of clInput.
commandline_state.clInput.value =
initialClInputValue

View file

@ -212,7 +212,7 @@ function* ParserController() {
if (response.exstr) {
exstr = response.exstr
if (exstr.startsWith("fillcmdline")) { // TODO That's ugly. I need a way to know if this command is going to open the command line. Is there a better way?
if (exstr === "fillcmdline" || exstr === "fillcmdline_notrail") {
logger.debug("Starting buffering of page keys")
bufferingPageKeysBeginTime = performance.now()
mustBufferPageKeysForClInput = true