File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ export type {
2
+ Context ,
3
+ Dispatcher ,
4
+ } from "https://deno.land/x/denops@v0.7/mod.ts" ;
5
+ export { Denops } from "https://deno.land/x/denops@v0.7/mod.ts" ;
Original file line number Diff line number Diff line change
1
+ import { Denops } from "./deps.ts" ;
2
+
3
+ /**
4
+ * Execute Vim script directly
5
+ */
6
+ export async function execute (
7
+ denops : Denops ,
8
+ command : string | string [ ] ,
9
+ ) : Promise < void > {
10
+ if ( Array . isArray ( command ) ) {
11
+ await denops . cmd ( "call execute(l:command, '')" , {
12
+ command : command
13
+ . map ( ( x ) => x . replace ( / ^ \s + | \s + $ / g, "" ) )
14
+ . filter ( ( x ) => ! ! x ) ,
15
+ } ) ;
16
+ return ;
17
+ }
18
+ command = command . replace ( / \r ? \n \s * \\ / g, "" ) ;
19
+ await execute ( denops , command . split ( / \r ? \n / g) ) ;
20
+ }
Original file line number Diff line number Diff line change
1
+ export * from "./execute.ts" ;
You can’t perform that action at this time.
0 commit comments