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

fix(alternative): fix a.vim and a.lua

This commit is contained in:
wsdjeg 2022-09-11 21:11:40 +08:00
parent a98b324a01
commit 43f7c8f78a
2 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ else
" saving cache
function! s:cache() abort
call writefile([s:JSON.json_encode(s:project_config)], s:FILE.unify_path(s:cache_path, ':p'))
silent call writefile([s:JSON.json_encode(s:project_config)], s:FILE.unify_path(s:cache_path, ':p'))
endfunction
function! s:load_cache() abort

View File

@ -27,11 +27,11 @@ local project_config = {}
local function cache()
logger.debug('write cache into file:' .. cache_path)
local rst = fn.writefile({sp_json.json_encode(project_config)}, cache_path)
if rst == 0 then
logger.debug('cache succeeded!')
else
local ok, errors = pcall(fn.writefile, {sp_json.json_encode(project_config)}, cache_path)
if not ok then
logger.debug('cache failed!')
else
logger.debug('cache succeeded!')
end
end