* make :FZF work in Vim from Git Bash
Despite its title 'Calling fzf#run with a list as source fail (n)vim is used from git bash' the issue in
https://github.com/junegunn/fzf/issues/3777
of running `:FZF` in Vim in Git Bash was apparently only fixed for Neovim in Git Bash on Windows 11, but not for Vim from Git Bash.
In view of this, replacing /C by ///C might be considered a universal fix.
This PR just proposes the patch in https://github.com/junegunn/fzf/issues/1983 that still seems open.
In view of the fourth item in the most recent 2.45.0 https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#known-issues little seems to have changed regarding path conversion of arguments containing forward slashes
* prefer doubling slashed instead of generic env. var
If MSYS_NO_PATHCONV=1 is used, then all arguments are preserved, in particular possibly paths passed in s:command.
Therefore, only avoid converting `/C` from `cmd` to a path.
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().