Fix #337 don't create user snippet directory

This commit is contained in:
Shougo Matsushita 2016-03-05 17:12:12 +09:00
parent e908126f40
commit bcb7620a85
2 changed files with 7 additions and 9 deletions

View File

@ -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

View File

@ -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 "{{{