1
- import { deferred , Denops } from "../deps.ts" ;
2
- import * as anonymous from "../anonymous/mod.ts" ;
1
+ import { Denops } from "../deps.ts" ;
3
2
import { batch } from "../batch/mod.ts" ;
4
- import { load } from "./load.ts" ;
5
3
6
4
/**
7
5
* Echo message as like `echo` on Vim script.
@@ -18,7 +16,10 @@ export function echo(denops: Denops, message: string): Promise<void> {
18
16
if ( denops . meta . mode === "test" ) {
19
17
return Promise . resolve ( ) ;
20
18
} else if ( denops . meta . host === "vim" ) {
21
- return echoVim ( denops , message ) ;
19
+ return denops . cmd (
20
+ "call timer_start(0, { -> execute('redraw | echo message', '') })" ,
21
+ { message } ,
22
+ ) ;
22
23
} else {
23
24
return denops . cmd ( "redraw | echo message" , { message } ) ;
24
25
}
@@ -61,11 +62,3 @@ export async function friendlyCall(
61
62
}
62
63
}
63
64
}
64
-
65
- async function echoVim ( denops : Denops , message : string ) : Promise < void > {
66
- await load ( denops , new URL ( "./echo.vim" , import . meta. url ) ) ;
67
- const waiter = deferred < void > ( ) ;
68
- const id = anonymous . once ( denops , ( ) => waiter . resolve ( ) ) [ 0 ] ;
69
- await denops . call ( "DenopsStdHelperEcho" , message , denops . name , id ) ;
70
- await waiter ;
71
- }
0 commit comments