@@ -34,19 +34,23 @@ export async function input(
34
34
await helper . load ( denops , new URL ( "./input.vim" , import . meta. url ) ) ;
35
35
const completion = options . completion ?? null ;
36
36
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 ) => {
38
38
ensureString ( arglead ) ;
39
39
ensureString ( cmdline ) ;
40
40
ensureNumber ( cursorpos ) ;
41
41
return await completion ( arglead , cmdline , cursorpos ) ;
42
42
} ) ;
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
+ }
50
54
}
51
55
if ( completion && ! fn . isValidBuiltinCompletion ( completion ) ) {
52
56
if (
0 commit comments