Fix #239 $XDG_CACHE_DIR

This commit is contained in:
Shougo Matsushita 2014-06-27 22:06:42 +09:00
parent c386150c0b
commit 8d61e62a65
2 changed files with 5 additions and 3 deletions

View File

@ -76,7 +76,9 @@ endfunction"}}}
function! neosnippet#variables#data_dir() "{{{ function! neosnippet#variables#data_dir() "{{{
let g:neosnippet#data_directory = let g:neosnippet#data_directory =
\ substitute(fnamemodify(get( \ substitute(fnamemodify(get(
\ g:, 'neosnippet#data_directory', '~/.cache/neosnippet'), \ g:, 'neosnippet#data_directory',
\ ($XDG_CACHE_DIR != '' ?
\ $XDG_CACHE_DIR . '/neosnippet' : expand('~/.cache/neosnippet'))),
\ ':p'), '\\', '/', 'g') \ ':p'), '\\', '/', 'g')
if !isdirectory(g:neosnippet#data_directory) if !isdirectory(g:neosnippet#data_directory)
call mkdir(g:neosnippet#data_directory, 'p') call mkdir(g:neosnippet#data_directory, 'p')

View File

@ -234,8 +234,8 @@ g:neosnippet#data_directory *g:neosnippet#data_directory*
Specifies directory for neosnippet cache. If the directory Specifies directory for neosnippet cache. If the directory
doesn't exist the directory will be automatically generated. doesn't exist the directory will be automatically generated.
Default value is expand('~/.cache/neosnippet'); the absolute Default value is "$XDG_CACHE_DIR/neosnippet" or
path of it. expand("~/.cache/neosnippet"); the absolute path of it.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
KEY MAPPINGS *neosnippet-key-mappings* KEY MAPPINGS *neosnippet-key-mappings*