Use fzf#wrap to respect user option

`fzf.vim` provides both `fzf#run` and `fzf#wrap`. The latter function is used to force `fzf#run` to respect user options defined in e.g. `g:fzf_layout`. I believe it is better to use this so that dressings fzf behaviour respects user options.

See `:help fzf#wrap` for more details.
This commit is contained in:
Karl Yngve Lervåg 2022-05-10 22:15:36 +02:00 committed by GitHub
parent a476efd3f3
commit dec32938b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,10 @@
function! dressing#fzf_run(labels, options, window) abort
call fzf#run({
call fzf#run(fzf#wrap({
\ 'source': a:labels,
\ 'sink': funcref('dressing#fzf_choice'),
\ 'options': a:options,
\ 'window': a:window,
\ })
\}))
endfunction
function! dressing#fzf_choice(label) abort