mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
feat(fzf): various improvements (#275)
* use fzf#wrap to repect user config * show the first item at the top * a space after index
This commit is contained in:
parent
603ffde23a
commit
66078ea0fa
2 changed files with 4 additions and 5 deletions
|
@ -3,12 +3,11 @@ function! aerial#fzf() abort
|
|||
if type(l:labels) == type(v:null) && l:labels == v:null
|
||||
return
|
||||
endif
|
||||
call fzf#run({
|
||||
call fzf#run(fzf#wrap({
|
||||
\ 'source': l:labels,
|
||||
\ 'sink': funcref('aerial#goto_symbol'),
|
||||
\ 'options': '--prompt="Document symbols: "',
|
||||
\ 'window': {'width': 0.5, 'height': 0.4},
|
||||
\ })
|
||||
\ 'options': ['--prompt="Document symbols: "', '--layout=reverse-list'],
|
||||
\ }))
|
||||
endfunction
|
||||
|
||||
function! aerial#goto_symbol(symbol) abort
|
||||
|
|
|
@ -15,7 +15,7 @@ M.get_labels = function(opts)
|
|||
local results = {}
|
||||
if data.has_symbols(0) then
|
||||
for _, item in data.get_or_create(0):iter({ skip_hidden = false }) do
|
||||
local label = string.format("%d:%s", item.idx, item.name)
|
||||
local label = string.format("%d: %s", item.idx, item.name)
|
||||
table.insert(results, label)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue