@@ -27,7 +27,9 @@ function! dein#util#_get_runtime_path() abort
27
27
return g: dein #_runtime_path
28
28
endif
29
29
30
- let g: dein #_runtime_path = dein#util#_get_cache_path () .. ' /.dein'
30
+ let g: dein #_runtime_path = dein#util#_substitute_path (
31
+ \ g: - >get (' dein#runtime_directory' , dein#util#_get_cache_path ()
32
+ \ .. ' /.dein/' ))
31
33
call dein#util#_safe_mkdir (g: dein #_runtime_path)
32
34
return g: dein #_runtime_path
33
35
endfunction
@@ -40,8 +42,8 @@ function! dein#util#_get_cache_path() abort
40
42
\ $NVIM_APPNAME :
41
43
\ dein#util#_get_myvimrc ()- >fnamemodify (' :t' )
42
44
let g: dein #_cache_path = dein#util#_substitute_path (
43
- \ g: - >get (' dein#cache_directory' , g: dein #_base_path)
44
- \ .. ' /.cache/' .. vimrc_path)
45
+ \ g: - >get (' dein#cache_directory' , g: dein #_base_path
46
+ \ .. ' /.cache/' .. vimrc_path))
45
47
call dein#util#_safe_mkdir (g: dein #_cache_path)
46
48
return g: dein #_cache_path
47
49
endfunction
@@ -163,14 +165,6 @@ function! dein#util#_check_clean() abort
163
165
\ })
164
166
endfunction
165
167
166
- function ! dein#util#_cache_writefile (list , path ) abort
167
- if ! (dein#util#_get_cache_path ()- >filewritable ())
168
- return 1
169
- endif
170
-
171
- const path = dein#util#_get_cache_path () .. ' /' .. a: path
172
- return dein#util#_safe_writefile (a: list , path )
173
- endfunction
174
168
function ! dein#util#_safe_writefile (list , path , flags = ' ' ) abort
175
169
if g: dein #_is_sudo
176
170
return 1
@@ -232,8 +226,8 @@ function! dein#util#_save_cache(vimrcs, is_state, is_starting) abort
232
226
const src = [plugins, g: dein #ftplugin]
233
227
call dein#util#_safe_writefile (
234
228
\ has (' nvim' ) ? [src - >json_encode ()] : [src - >js_encode ()],
235
- \ g: - > get ( ' dein#cache_directory ' , g: dein #_base_path )
236
- \ .. ' /cache_' .. g: dein #_progname)
229
+ \ dein#util#_get_cache_path ( )
230
+ \ .. ' /cache_' .. g: dein #_progname .. ' .json ' )
237
231
endfunction
238
232
function ! dein#util#_check_vimrcs () abort
239
233
const time = dein#util#_get_runtime_path ()- >getftime ()
@@ -379,12 +373,12 @@ function! dein#util#_save_state(is_starting) abort
379
373
\ event , plugins- >string ()))
380
374
endfor
381
375
382
- const state = g: - > get ( ' dein#cache_directory ' , g: dein #_base_path )
376
+ const state = dein#util#_get_cache_path ( )
383
377
\ .. ' /state_' .. g: dein #_progname .. ' .vim'
384
378
call dein#util#_safe_writefile (lines , state )
385
379
endfunction
386
380
function ! dein#util#_clear_state () abort
387
- const base = g: - > get ( ' dein#cache_directory ' , g: dein #_base_path )
381
+ const base = dein#util#_get_cache_path ( )
388
382
for cache in (base .. ' /state_*.vim' )- >glob (v: true , v: true )
389
383
\ + (base .. ' /cache_*' )- >glob (v: true , v: true )
390
384
call delete (cache)
0 commit comments