Clear cache file in NeoSnippetMakeCache

This commit is contained in:
Shougo Matsushita 2015-12-30 08:53:58 +09:00
parent 4782bda067
commit 3e6f927854

View File

@ -31,6 +31,7 @@ let s:edit_options = [
\ '-runtime', \ '-runtime',
\ '-vertical', '-horizontal', '-direction=', '-split', \ '-vertical', '-horizontal', '-direction=', '-split',
\] \]
let s:Cache = neosnippet#util#get_vital().import('System.Cache')
"}}} "}}}
function! s:get_list() "{{{ function! s:get_list() "{{{
@ -108,8 +109,11 @@ function! neosnippet#commands#_make_cache(filetype) "{{{
let snippets[filetype] = {} let snippets[filetype] = {}
let path = join(neosnippet#helpers#get_snippets_directory(), ',') let path = join(neosnippet#helpers#get_snippets_directory(), ',')
let cache_dir = neosnippet#variables#data_dir()
for filename in s:get_snippets_files(path, filetype) for filename in s:get_snippets_files(path, filetype)
" Clear cache file
call s:Cache.deletefile(cache_dir, filename)
let snippets[filetype] = extend(snippets[filetype], let snippets[filetype] = extend(snippets[filetype],
\ neosnippet#parser#_parse_snippets(filename)) \ neosnippet#parser#_parse_snippets(filename))
endfor endfor