Fix #337 don't create user snippet directory
This commit is contained in:
parent
e908126f40
commit
bcb7620a85
@ -68,6 +68,10 @@ function! neosnippet#commands#_edit(args) abort "{{{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !isdirectory(snippet_dir) && !neosnippet#util#is_sudo()
|
||||||
|
call mkdir(snippet_dir, 'p')
|
||||||
|
endif
|
||||||
|
|
||||||
" Edit snippet file.
|
" Edit snippet file.
|
||||||
let filename = snippet_dir .'/'.filetype
|
let filename = snippet_dir .'/'.filetype
|
||||||
|
|
||||||
|
@ -69,15 +69,9 @@ function! neosnippet#variables#set_snippets(list) abort "{{{
|
|||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
function! neosnippet#variables#snippets_dir() abort "{{{
|
function! neosnippet#variables#snippets_dir() abort "{{{
|
||||||
" Set snippets_dir.
|
" Set snippets_dir.
|
||||||
let snippets_dir = []
|
let snippets_dir = map(neosnippet#util#option2list(
|
||||||
for dir in neosnippet#util#option2list(g:neosnippet#snippets_directory)
|
\ g:neosnippet#snippets_directory),
|
||||||
let dir = neosnippet#util#expand(dir)
|
\ 'neosnippet#util#expand(v:val)')
|
||||||
if !isdirectory(dir) && !neosnippet#util#is_sudo()
|
|
||||||
call mkdir(dir, 'p')
|
|
||||||
endif
|
|
||||||
call add(snippets_dir, dir)
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return map(snippets_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
|
return map(snippets_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
function! neosnippet#variables#runtime_dir() abort "{{{
|
function! neosnippet#variables#runtime_dir() abort "{{{
|
||||||
|
Loading…
Reference in New Issue
Block a user