Fix sudo problem

This commit is contained in:
Shougo Matsushita 2018-01-26 08:39:05 +09:00
parent add11c0c40
commit bf3b68aeeb

View File

@ -13,6 +13,11 @@ function! neosnippet#parser#_parse_snippets(filename) abort
return {}
endif
if neosnippet#util#is_sudo()
let [snippets, sourced] = s:parse(a:filename)
return snippets
endif
let cache_dir = neosnippet#variables#data_dir()
let snippets = {}
if !s:Cache.check_old_cache(cache_dir, a:filename)
@ -24,7 +29,7 @@ function! neosnippet#parser#_parse_snippets(filename) abort
endif
if empty(snippets) || s:Cache.check_old_cache(cache_dir, a:filename)
let [snippets, sourced] = s:parse(a:filename)
if len(snippets) > 5 && !neosnippet#util#is_sudo() && !sourced
if len(snippets) > 5 && !sourced
call s:Cache.writefile(
\ cache_dir, a:filename,
\ [neosnippet#helpers#vim2json(snippets)])