1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:10:07 +08:00

fix(cache): use data_dir for SpaceVim cache

ref: https://github.com/SpaceVim/SpaceVim/issues/4499
This commit is contained in:
wsdjeg 2022-01-06 13:13:10 +08:00
parent 7e77fd9fb4
commit 07e6c2f9f4
2 changed files with 4 additions and 4 deletions

View File

@ -772,8 +772,8 @@ function! SpaceVim#layers#core#statusline#config() abort
\ 'main': 'SpaceVim#layers#core#statusline#ctrlp',
\ 'prog': 'SpaceVim#layers#core#statusline#ctrlp_status',
\ }
if filereadable(expand('~/.cache/SpaceVim/major_mode.json'))
let conf = s:JSON.json_decode(join(readfile(expand('~/.cache/SpaceVim/major_mode.json'), ''), ''))
if filereadable(expand(g:spacevim_data_dir . 'SpaceVim/major_mode.json'))
let conf = s:JSON.json_decode(join(readfile(expand(g:spacevim_data_dir . 'SpaceVim/major_mode.json'), ''), ''))
for key in keys(conf)
if conf[key]
" this function should be called silent.
@ -788,7 +788,7 @@ function! s:update_conf() abort
for key in keys(s:modes)
call extend(conf, {key : (index(s:loaded_modes, key) > -1 ? 1 : 0)})
endfor
call writefile([s:JSON.json_encode(conf)], expand('~/.cache/SpaceVim/major_mode.json'))
call writefile([s:JSON.json_encode(conf)], expand(g:spacevim_data_dir . 'SpaceVim/major_mode.json'))
endfunction
" Arguments:

View File

@ -39,7 +39,7 @@ let s:FILE = SpaceVim#api#import('file')
let s:gtagslabel = ''
let s:auto_update = 1
let g:tags_cache_dir = '~/.cache/SpaceVim/tags/'
let g:tags_cache_dir = g:spacevim_data_dir . 'SpaceVim/tags/'
let g:gtags_open_list = 2
function! SpaceVim#layers#gtags#plugins() abort