Fix sudo problem
This commit is contained in:
parent
add11c0c40
commit
bf3b68aeeb
@ -13,6 +13,11 @@ function! neosnippet#parser#_parse_snippets(filename) abort
|
|||||||
return {}
|
return {}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if neosnippet#util#is_sudo()
|
||||||
|
let [snippets, sourced] = s:parse(a:filename)
|
||||||
|
return snippets
|
||||||
|
endif
|
||||||
|
|
||||||
let cache_dir = neosnippet#variables#data_dir()
|
let cache_dir = neosnippet#variables#data_dir()
|
||||||
let snippets = {}
|
let snippets = {}
|
||||||
if !s:Cache.check_old_cache(cache_dir, a:filename)
|
if !s:Cache.check_old_cache(cache_dir, a:filename)
|
||||||
@ -24,7 +29,7 @@ function! neosnippet#parser#_parse_snippets(filename) abort
|
|||||||
endif
|
endif
|
||||||
if empty(snippets) || s:Cache.check_old_cache(cache_dir, a:filename)
|
if empty(snippets) || s:Cache.check_old_cache(cache_dir, a:filename)
|
||||||
let [snippets, sourced] = s:parse(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(
|
call s:Cache.writefile(
|
||||||
\ cache_dir, a:filename,
|
\ cache_dir, a:filename,
|
||||||
\ [neosnippet#helpers#vim2json(snippets)])
|
\ [neosnippet#helpers#vim2json(snippets)])
|
||||||
|
Loading…
Reference in New Issue
Block a user