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
endif
if !isdirectory(snippet_dir) && !neosnippet#util#is_sudo()
call mkdir(snippet_dir, 'p')
endif
" Edit snippet file.
let filename = snippet_dir .'/'.filetype

View File

@ -69,15 +69,9 @@ function! neosnippet#variables#set_snippets(list) abort "{{{
endfunction"}}}
function! neosnippet#variables#snippets_dir() abort "{{{
" Set snippets_dir.
let snippets_dir = []
for dir in neosnippet#util#option2list(g:neosnippet#snippets_directory)
let dir = neosnippet#util#expand(dir)
if !isdirectory(dir) && !neosnippet#util#is_sudo()
call mkdir(dir, 'p')
endif
call add(snippets_dir, dir)
endfor
let snippets_dir = map(neosnippet#util#option2list(
\ g:neosnippet#snippets_directory),
\ 'neosnippet#util#expand(v:val)')
return map(snippets_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
endfunction"}}}
function! neosnippet#variables#runtime_dir() abort "{{{