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

fix(flygrep): check if filewritable

This commit is contained in:
wsdjeg 2022-09-11 21:25:48 +08:00
parent 43f7c8f78a
commit 9f6420aca6

View File

@ -78,7 +78,9 @@ function! s:update_history() abort
if !isdirectory(expand(g:spacevim_data_dir.'SpaceVim'))
silent call mkdir(expand(g:spacevim_data_dir.'SpaceVim'))
endif
silent call writefile([s:JSON.json_encode(s:grep_history)], expand(g:spacevim_data_dir.'SpaceVim/flygrep_history'))
if filewritable(expand(g:spacevim_data_dir.'SpaceVim/flygrep_history'))
call writefile([s:JSON.json_encode(s:grep_history)], expand(g:spacevim_data_dir.'SpaceVim/flygrep_history'))
endif
endfunction
let s:grep_history = s:read_histroy()
let s:complete_input_history_num = [0,0]