@@ -34,19 +34,23 @@ export async function input(
3434 await helper . load ( denops , new URL ( "./input.vim" , import . meta. url ) ) ;
3535 const completion = options . completion ?? null ;
3636 if ( completion && typeof completion !== "string" ) {
37- const [ id ] = anonymous . once ( denops , async ( arglead , cmdline , cursorpos ) => {
37+ const [ id ] = anonymous . add ( denops , async ( arglead , cmdline , cursorpos ) => {
3838 ensureString ( arglead ) ;
3939 ensureString ( cmdline ) ;
4040 ensureNumber ( cursorpos ) ;
4141 return await completion ( arglead , cmdline , cursorpos ) ;
4242 } ) ;
43- return await denops . call (
44- "DenopsStdHelperInput" ,
45- options . prompt ?? "" ,
46- options . text ?? "" ,
47- { plugin : denops . name , id } ,
48- options . inputsave ?? false ,
49- ) as Promise < string | null > ;
43+ try {
44+ return await denops . call (
45+ "DenopsStdHelperInput" ,
46+ options . prompt ?? "" ,
47+ options . text ?? "" ,
48+ { plugin : denops . name , id } ,
49+ options . inputsave ?? false ,
50+ ) as Promise < string | null > ;
51+ } finally {
52+ anonymous . remove ( denops , id ) ;
53+ }
5054 }
5155 if ( completion && ! fn . isValidBuiltinCompletion ( completion ) ) {
5256 if (
0 commit comments