We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
ctrlp#utils#cachefile by default uses getcwd() as the cache filename. And it is called in https://github.com/ctrlpvim/ctrlp.vim/blob/master/autoload/ctrlp.vim#L381 without any parameter.
getcwd()
When autochdir is set, opening ctrlp with files in the same project root but that belongs to different directory causes reindexing to occur.
autochdir
Can't the cache file uses to project root as base filename instead?
The text was updated successfully, but these errors were encountered:
What works for me
diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index d4445c8..0b074d4 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -379,7 +379,7 @@ fu! s:Reset(args) endf " * Files {{{1 fu! ctrlp#files() - let cafile = ctrlp#utils#cachefile() + let cafile = ctrlp#utils#cachefile(s:dyncwd, 1) if g:ctrlp_newcache || !filereadable(cafile) || s:nocache(cafile) let [lscmd, s:initcwd, g:ctrlp_allfiles] = [s:lsCmd(), s:dyncwd, []] " Get the list of files @@ -2637,7 +2637,7 @@ endf " Cache {{{2 fu! s:writecache(cafile) if ( g:ctrlp_newcache || !filereadable(a:cafile) ) && !s:nocache() - cal ctrlp#utils#writecache(g:ctrlp_allfiles) + cal ctrlp#utils#writecache(g:ctrlp_allfiles, ctrlp#utils#cachedir(), a:cafile) let g:ctrlp_newcache = 0 en endf @@ -2670,7 +2670,7 @@ fu! s:insertcache(str) endfo en cal insert(data, str, pos) - cal s:writecache(ctrlp#utils#cachefile()) + cal s:writecache(ctrlp#utils#cachefile(s:dyncwd, 1)) endf " Extensions {{{2 fu! s:mtype()
Sorry, something went wrong.
No branches or pull requests
Hi,
ctrlp#utils#cachefile by default uses
getcwd()
as the cache filename. And it is called in https://github.com/ctrlpvim/ctrlp.vim/blob/master/autoload/ctrlp.vim#L381 without any parameter.When
autochdir
is set, opening ctrlp with files in the same project root but that belongs to different directory causes reindexing to occur.Can't the cache file uses to project root as base filename instead?
The text was updated successfully, but these errors were encountered: