diff options
author | Daniel Zhang <wodesuck@gmail.com> | 2022-05-25 08:50:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 09:50:10 +0900 |
commit | 3b7a962dc6db227d18faecb25c793431ce7e8640 (patch) | |
tree | 8eda410a740ca7055647571687306566cb86253f /plugin/fzf.vim | |
parent | 6dcf5c3d7d6c321b17e6a5673f1533d6e8350462 (diff) |
[vim] Fix fzf#shellescape when shell=fish (#2828)
`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>
Diffstat (limited to 'plugin/fzf.vim')
-rw-r--r-- | plugin/fzf.vim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 3c705e91..85d1f2fa 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -96,7 +96,12 @@ function! fzf#shellescape(arg, ...) if shell =~# 'cmd.exe$' return s:shellesc_cmd(a:arg) endif - return s:fzf_call('shellescape', a:arg) + try + let [shell, &shell] = [&shell, shell] + return s:fzf_call('shellescape', a:arg) + finally + let [shell, &shell] = [&shell, shell] + endtry endfunction function! s:fzf_getcwd() |