And simplify the argument escaping code. Fix#3764.
This may breaks some existing use cases, but the mode causes too much
trouble when escaping arguments and it makes some things not possible.
# Now you can pass special characters to rg process without any escaping problems: &|<>()@^%!
fzf --ansi --disabled --bind "change:reload:rg --column --line-number --no-heading --color=always --smart-case -- {q}"
# No sudden expansion of the arguments on '!'
fzf --disabled --preview "echo {q} {n} {}" --query "&|<>()@^%!" --prompt "&|<>()@^%!"
In Neovim, the foreground and background colors of a floating window
defaults to those of Pmenu highlight group, which yields unexpected
results.
This commit makes the colors of fzf window defaults to those of 'Normal'
group (or 'NormalFloat' if defined), by ignoring Pmenu group.
Then the colors can be configured via --color option of fzf.
NOTE: An error from setwinvar call is ignored because the exact
behavior of &winhighlight with an empty target group is not clearly
documented.
Close#3035
Close https://github.com/junegunn/fzf.vim/issues/1431
See https://github.com/neovim/neovim/pull/9722#discussion_r264777602
`shellescape()` behavior is different when `shell=fish`, so we should set `shell` before calling `shellescape()`, otherwise an unexpected result may occur (e.g. https://github.com/kevinhwang91/nvim-bqf/issues/56).
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
So that it's easier to add a sinklist function to a spec dictionary.
let spec = { 'source': source, 'options': ['--preview', preview] }
function spec.sinklist(matches)
echom string(a:matches)
endfunction
call fzf#run(fzf#wrap(spec))
When 'down' layout was used on regular Vim on terminal, fzf would open
below the editor using `--height` option. This was the only case where
terminal buffer was not used (the code was written when Vim didn't have
builtin terminal) and this exception has been a constant source of
confusion.
This commit makes fzf open in a terminal buffer even in that case.
The clean-up is done in s:collect(), so let's make sure it's run before
we may terminate due to CTRL-C or ESC (or some other error code) in
s:exit_handler().