File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import type { Denops } from "https://deno.land/x/denops_core@v3.0.2/mod.ts";
2
2
import * as autocmd from "../autocmd/mod.ts" ;
3
3
import * as batch from "../batch/mod.ts" ;
4
4
import * as fn from "../function/mod.ts" ;
5
- import * as vars from "../variable/mod.ts" ;
6
5
import { execute } from "../helper/mod.ts" ;
7
6
import * as unknownutil from "https://deno.land/x/unknownutil@v2.0.0/mod.ts" ;
8
7
import {
@@ -15,15 +14,15 @@ import {
15
14
import { tryDecode } from "./fileencoding.ts" ;
16
15
import { generateUniqueString } from "../util.ts" ;
17
16
17
+ const cacheKey = Symbol ( "denops_std/buffer/buffer.ts" ) ;
18
18
const suffix = generateUniqueString ( ) ;
19
19
20
20
async function ensurePrerequisites ( denops : Denops ) : Promise < string > {
21
- if ( await vars . g . get ( denops , `loaded_denops_std_buffer_ ${ suffix } ` ) ) {
21
+ if ( cacheKey in denops . context ) {
22
22
return suffix ;
23
23
}
24
+ denops . context [ cacheKey ] = true ;
24
25
const script = `
25
- let g:loaded_denops_std_buffer_${ suffix } = 1
26
-
27
26
function! DenopsStdBufferReload_${ suffix } (bufnr) abort
28
27
if bufnr('%') is# a:bufnr
29
28
edit
Original file line number Diff line number Diff line change 1
1
import type { Denops } from "https://deno.land/x/denops_core@v3.0.2/mod.ts" ;
2
- import * as vars from "../variable/mod.ts" ;
3
2
import { execute } from "./execute.ts" ;
4
3
import { batch } from "../batch/mod.ts" ;
5
4
import { generateUniqueString } from "../util.ts" ;
6
5
6
+ const cacheKey = Symbol ( "denops_std/helper/echo" ) ;
7
7
const suffix = generateUniqueString ( ) ;
8
8
9
9
async function ensurePrerequisites ( denops : Denops ) : Promise < string > {
10
- if ( await vars . g . get ( denops , `loaded_denops_std_helper_echo_ ${ suffix } ` ) ) {
10
+ if ( cacheKey in denops . context ) {
11
11
return suffix ;
12
12
}
13
+ denops . context [ cacheKey ] = true ;
13
14
const script = `
14
15
let g:loaded_denops_std_helper_echo_${ suffix } = 1
15
16
Original file line number Diff line number Diff line change @@ -4,17 +4,18 @@ import {
4
4
assertString ,
5
5
} from "https://deno.land/x/unknownutil@v2.0.0/mod.ts" ;
6
6
import * as fn from "../function/mod.ts" ;
7
- import * as vars from "../variable/mod.ts" ;
8
7
import * as anonymous from "../anonymous/mod.ts" ;
9
8
import { execute } from "./execute.ts" ;
10
9
import { generateUniqueString } from "../util.ts" ;
11
10
11
+ const cacheKey = Symbol ( "denops_std/helper/input" ) ;
12
12
const suffix = generateUniqueString ( ) ;
13
13
14
14
async function ensurePrerequisites ( denops : Denops ) : Promise < string > {
15
- if ( await vars . g . get ( denops , `loaded_denops_std_helper_input_ ${ suffix } ` ) ) {
15
+ if ( cacheKey in denops . context ) {
16
16
return suffix ;
17
17
}
18
+ denops . context [ cacheKey ] = true ;
18
19
const script = `
19
20
let s:loaded_denops_std_helper_input_${ suffix } = 1
20
21
You can’t perform that action at this time.
0 commit comments