1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 13:00:05 +08:00
SpaceVim/bundle/bookmarks.vim/autoload/bookmarks/cache.vim

20 lines
425 B
VimL
Raw Normal View History

let s:cache_path = g:spacevim_data_dir . 'SpaceVim/bookmarks.json'
function! bookmarks#cache#write(data) abort
call writefile([json_encode(a:data)], s:cache_path)
endfunction
function! bookmarks#cache#read() abort
if filereadable(s:cache_path)
let data = join(readfile(s:cache_path), '')
if data !=# ''
return json_decode(data)
else
return {}
endif
else
return {}
endif
endfunction