Fix cache directory creation
Revert some changes in 6fe1e50. Refs #109.
This commit is contained in:
parent
6fe1e509c2
commit
17772fa8d8
@ -807,7 +807,7 @@ fu! s:CreateNewFile(...) "{{{1
|
|||||||
let str = fnamemodify(pah.s:lash(pah).str, ':.')
|
let str = fnamemodify(pah.s:lash(pah).str, ':.')
|
||||||
en
|
en
|
||||||
en
|
en
|
||||||
if len(arr) | if isdirectory(ctrlp#utils#createpath(arr))
|
if len(arr) | if isdirectory(s:createpath(arr))
|
||||||
let optyp = str | en | el | let optyp = fname
|
let optyp = str | en | el | let optyp = fname
|
||||||
en
|
en
|
||||||
if !exists('optyp') | retu | en
|
if !exists('optyp') | retu | en
|
||||||
@ -1031,6 +1031,14 @@ fu! s:ispathitem()
|
|||||||
\ || ( s:itemtype > 2 && g:ctrlp_ext_vars[ext]['type'] == 'path' )
|
\ || ( s:itemtype > 2 && g:ctrlp_ext_vars[ext]['type'] == 'path' )
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! s:createpath(arr)
|
||||||
|
for each in a:arr
|
||||||
|
let curr = exists('curr') ? curr.s:lash(curr).each : each
|
||||||
|
cal ctrlp#utils#mkdir(curr)
|
||||||
|
endfo
|
||||||
|
retu curr
|
||||||
|
endf
|
||||||
|
|
||||||
fu! ctrlp#dirnfile(entries)
|
fu! ctrlp#dirnfile(entries)
|
||||||
let [items, cwd] = [[[], []], getcwd().s:lash()]
|
let [items, cwd] = [[[], []], getcwd().s:lash()]
|
||||||
for each in a:entries
|
for each in a:entries
|
||||||
|
@ -15,10 +15,7 @@ fu! s:lash(...)
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#utils#opts()
|
fu! ctrlp#utils#opts()
|
||||||
let usrhome = $HOME.s:lash($HOME)
|
let s:cache_dir = $HOME.s:lash($HOME).'.ctrlp_cache'
|
||||||
let cahome = usrhome.'.cache'
|
|
||||||
let s:cache_dir = isdirectory(usrhome.'.ctrlp_cache')
|
|
||||||
\ ? usrhome.'.ctrlp_cache' : cahome.s:lash(cahome).'ctrlp'
|
|
||||||
if exists('g:ctrlp_cache_dir')
|
if exists('g:ctrlp_cache_dir')
|
||||||
let s:cache_dir = expand(g:ctrlp_cache_dir, 1)
|
let s:cache_dir = expand(g:ctrlp_cache_dir, 1)
|
||||||
if isdirectory(s:cache_dir.s:lash(s:cache_dir).'.ctrlp_cache')
|
if isdirectory(s:cache_dir.s:lash(s:cache_dir).'.ctrlp_cache')
|
||||||
@ -56,16 +53,10 @@ fu! ctrlp#utils#mkdir(dir)
|
|||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#utils#createpath(arr)
|
|
||||||
for each in a:arr
|
|
||||||
let curr = exists('curr') ? curr.s:lash(curr).each : each
|
|
||||||
cal ctrlp#utils#mkdir(curr)
|
|
||||||
endfo
|
|
||||||
retu curr
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#writecache(lines, ...)
|
fu! ctrlp#utils#writecache(lines, ...)
|
||||||
if isdirectory(ctrlp#utils#createpath(split(a:0 ? a:1 : s:cache_dir, '[\/]')))
|
let cache_dir = exists('a:1') ? a:1 : s:cache_dir
|
||||||
|
cal ctrlp#utils#mkdir(cache_dir)
|
||||||
|
if isdirectory(cache_dir)
|
||||||
sil! cal writefile(a:lines, exists('a:2') ? a:2 : ctrlp#utils#cachefile())
|
sil! cal writefile(a:lines, exists('a:2') ? a:2 : ctrlp#utils#cachefile())
|
||||||
if !exists('a:1')
|
if !exists('a:1')
|
||||||
let g:ctrlp_newcache = 0
|
let g:ctrlp_newcache = 0
|
||||||
|
@ -123,7 +123,7 @@ upon exiting Vim: >
|
|||||||
|
|
||||||
*'g:ctrlp_cache_dir'*
|
*'g:ctrlp_cache_dir'*
|
||||||
Set the directory to store the cache files: >
|
Set the directory to store the cache files: >
|
||||||
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
|
let g:ctrlp_cache_dir = $HOME.'/.ctrlp_cache'
|
||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_prompt_mappings'*
|
*'g:ctrlp_prompt_mappings'*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user