@@ -14,34 +14,35 @@ minimal supported Vim and Neovim versions.
14
14
## Example
15
15
16
16
``` typescript
17
+ import { Denops } from " https://deno.land/x/denops_std/mod.ts" ;
17
18
import * as op from " https://deno.land/x/denops_std/option/mod.ts" ;
18
19
import * as vimOp from " https://deno.land/x/denops_std/option/vim/mod.ts" ;
19
20
import * as nvimOp from " https://deno.land/x/denops_std/option/nvim/mod.ts" ;
20
21
21
- export async function main(denops ) {
22
+ export async function main(denops : Denops ) : Promise < void > {
22
23
// Get value of the option.
23
24
// `get` is available on any options
24
25
// `getGlobal` is available on only global options
25
26
// `getLocal` is available on only local options
26
- console .log (await op .filetype .get (denops ));
27
- console .log (await op .filetype .getGlobal (denops ));
28
- console .log (await op .filetype .getLocal (denops ));
27
+ console .log (await op .autoread .get (denops ));
28
+ console .log (await op .autoread .getGlobal (denops ));
29
+ console .log (await op .autoread .getLocal (denops ));
29
30
30
31
// Set value of the option.
31
32
// `set` is available on any options
32
33
// `setGlobal` is available on only global options
33
34
// `setLocal` is available on only local options
34
- await op .filetype .set (denops , " hello " );
35
- await op .filetype .setGlobal (denops , " hello " );
36
- await op .filetype .setLocal (denops , " hello " );
35
+ await op .autoread .set (denops , true );
36
+ await op .autoread .setGlobal (denops , true );
37
+ await op .autoread .setLocal (denops , true );
37
38
38
39
// Reset the option.
39
40
// `reset` is available on any options
40
41
// `resetGlobal` is available on only global options
41
42
// `resetLocal` is available on only local options
42
- await op .filetype .reset (denops );
43
- await op .filetype .resetGlobal (denops );
44
- await op .filetype .resetLocal (denops );
43
+ await op .autoread .reset (denops );
44
+ await op .autoread .resetGlobal (denops );
45
+ await op .autoread .resetLocal (denops );
45
46
46
47
// vimOp has options only exist in Vim
47
48
console .log (await vimOp .compatible .get (denops ));
0 commit comments