Skip to content

Commit

Permalink
feat(fzf): various improvements (#275)
Browse files Browse the repository at this point in the history
* use fzf#wrap to repect user config
* show the first item at the top
* a space after index
  • Loading branch information
tomtomjhj committed Jul 11, 2023
1 parent 603ffde commit 66078ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions autoload/aerial.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/aerial/fzf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66078ea

Please sign in to comment.