From 93020300a601e196754c718a8dddc6ebc88c5c3f Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Sat, 4 Jul 2026 15:04:08 +0200 Subject: [PATCH] Fix #5402: make fillcmdline_tmp return early --- src/excmds.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/excmds.ts b/src/excmds.ts index 43d072a4..1e2fdbfd 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -4048,18 +4048,16 @@ export function fillcmdline_nofocus(...strarr: string[]) { /** Shows str in the command line for ms milliseconds. Recommended duration: 3000ms. */ //#content -export async function fillcmdline_tmp(ms: number, ...strarr: string[]) { +export function fillcmdline_tmp(ms: number, ...strarr: string[]) { showcmdline(false) - Messaging.messageOwnTab("commandline_frame", "fillcmdline", [strarr.join(" "), false, false]) - return new Promise(resolve => - setTimeout(async () => { - if (document.activeElement?.id !== "cmdline_iframe") { - CommandLineContent.hide_and_blur() - resolve(Messaging.messageOwnTab("commandline_frame", "clear", [true])) - } - resolve() - }, ms), - ) + const done = Messaging.messageOwnTab("commandline_frame", "fillcmdline", [strarr.join(" "), false, false]) + setTimeout(() => { + if (document.activeElement?.id !== "cmdline_iframe") { + CommandLineContent.hide_and_blur() + Messaging.messageOwnTab("commandline_frame", "clear", [true]) + } + }, ms) + return done } /**