Add undocumented fzf#vim#_recent_files function (#1024)

* Rename and make `s:all_files` public for user fzf extension
This commit is contained in:
Jesse Leite
2020-05-12 11:33:34 -04:00
committed by GitHub
parent 3925db8307
commit a74605b81d

View File

@@ -469,7 +469,7 @@ endfunction
" ------------------------------------------------------------------ " ------------------------------------------------------------------
" History[:/] " History[:/]
" ------------------------------------------------------------------ " ------------------------------------------------------------------
function! s:all_files() function! fzf#vim#_recent_files()
return fzf#vim#_uniq(map( return fzf#vim#_uniq(map(
\ filter([expand('%')], 'len(v:val)') \ filter([expand('%')], 'len(v:val)')
\ + filter(map(s:buflisted_sorted(), 'bufname(v:val)'), 'len(v:val)') \ + filter(map(s:buflisted_sorted(), 'bufname(v:val)'), 'len(v:val)')
@@ -534,7 +534,7 @@ endfunction
function! fzf#vim#history(...) function! fzf#vim#history(...)
return s:fzf('history-files', { return s:fzf('history-files', {
\ 'source': s:all_files(), \ 'source': fzf#vim#_recent_files(),
\ 'options': ['-m', '--header-lines', !empty(expand('%')), '--prompt', 'Hist> '] \ 'options': ['-m', '--header-lines', !empty(expand('%')), '--prompt', 'Hist> ']
\}, a:000) \}, a:000)
endfunction endfunction