mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-02-04 09:02:53 +08:00
[Tags] Use 'readtags' if query string is given
This pre-filtering is critical when working with large tag files. 'readtags' can perform a binary search for the given prefix string but fzf has to load the entire file into memory just to start searching. Close #1529 Close #1524
This commit is contained in:
@@ -1110,8 +1110,9 @@ function! fzf#vim#tags(query, ...)
|
||||
endfor
|
||||
let opts = v2_limit < 0 ? ['--algo=v1'] : []
|
||||
|
||||
let args = insert(map(tagfiles, 'fzf#shellescape(fnamemodify(v:val, ":p"))'), fzf#shellescape(a:query), 0)
|
||||
return s:fzf('tags', {
|
||||
\ 'source': 'perl '.fzf#shellescape(s:bin.tags).' '.join(map(tagfiles, 'fzf#shellescape(fnamemodify(v:val, ":p"))')),
|
||||
\ 'source': join(['perl', fzf#shellescape(s:bin.tags), join(args)]),
|
||||
\ 'sink*': s:function('s:tags_sink'),
|
||||
\ 'options': extend(opts, ['--nth', '1..2', '-m', '-d', '\t', '--tiebreak=begin', '--prompt', 'Tags> ', '--query', a:query])}, a:000)
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user