Remix when MRU list changes
This commit is contained in:
parent
dfd54e1d33
commit
045b66a6ab
@ -28,7 +28,8 @@ let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
||||
fu! s:newcache(cwd)
|
||||
if g:ctrlp_newmix || !has_key(g:ctrlp_allmixes, 'data') | retu 1 | en
|
||||
retu g:ctrlp_allmixes['cwd'] != a:cwd
|
||||
\ || g:ctrlp_allmixes['time'] < getftime(ctrlp#utils#cachefile())
|
||||
\ || g:ctrlp_allmixes['filtime'] < getftime(ctrlp#utils#cachefile())
|
||||
\ || g:ctrlp_allmixes['mrutime'] < getftime(ctrlp#mrufiles#cachefile())
|
||||
\ || g:ctrlp_allmixes['bufs'] < len(ctrlp#mrufiles#mrufs())
|
||||
endf
|
||||
|
||||
@ -59,8 +60,9 @@ fu! s:getnewmix(cwd, clim)
|
||||
if len(g:ctrlp_lines) <= a:clim
|
||||
cal sort(g:ctrlp_lines, 'ctrlp#complen')
|
||||
en
|
||||
let g:ctrlp_allmixes = { 'time': getftime(ctrlp#utils#cachefile()),
|
||||
\ 'cwd': a:cwd, 'bufs': len(ctrlp#mrufiles#mrufs()), 'data': g:ctrlp_lines }
|
||||
let g:ctrlp_allmixes = { 'filtime': getftime(ctrlp#utils#cachefile()),
|
||||
\ 'mrutime': getftime(ctrlp#mrufiles#cachefile()), 'cwd': a:cwd,
|
||||
\ 'bufs': len(ctrlp#mrufiles#mrufs()), 'data': g:ctrlp_lines }
|
||||
endf
|
||||
" Public {{{1
|
||||
fu! ctrlp#mixed#init(clim)
|
||||
|
@ -26,7 +26,7 @@ fu! s:excl(fn)
|
||||
endf
|
||||
|
||||
fu! s:mergelists()
|
||||
let diskmrufs = s:readcache()
|
||||
let diskmrufs = ctrlp#utils#readfile(ctrlp#mrufiles#cachefile())
|
||||
cal filter(diskmrufs, 'index(s:mrufs, v:val) < 0')
|
||||
let mrufs = s:mrufs + diskmrufs
|
||||
if v:version < 702 | cal filter(mrufs, 'count(mrufs, v:val) == 1') | en
|
||||
@ -38,14 +38,6 @@ fu! s:chop(mrufs)
|
||||
retu a:mrufs
|
||||
endf
|
||||
|
||||
fu! s:readcache()
|
||||
if !exists('s:cadir') || !exists('s:cafile')
|
||||
let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru'
|
||||
let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
|
||||
en
|
||||
retu ctrlp#utils#readfile(s:cafile)
|
||||
endf
|
||||
|
||||
fu! s:reformat(mrufs)
|
||||
if s:re
|
||||
let cwd = exists('+ssl') ? tr(getcwd(), '/', '\') : getcwd()
|
||||
@ -109,6 +101,14 @@ fu! ctrlp#mrufiles#mrufs()
|
||||
retu s:mrufs
|
||||
endf
|
||||
|
||||
fu! ctrlp#mrufiles#cachefile()
|
||||
if !exists('s:cadir') || !exists('s:cafile')
|
||||
let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru'
|
||||
let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
|
||||
en
|
||||
retu s:cafile
|
||||
endf
|
||||
|
||||
fu! ctrlp#mrufiles#init()
|
||||
if !has('autocmd') | retu | en
|
||||
let s:locked = 0
|
||||
|
Loading…
Reference in New Issue
Block a user