fzf: [regression] sink function calling fzf#run() puts vim in normal mode instead of terminal
- I have read through the manual page (
man fzf
) - I have the latest version of fzf
- I have searched through the existing issues
Info
-
OS
- Linux
-
Shell
- bash
Env
NVIM v0.5.0-dev+1085-g52397aaa0
> nvim --version
NVIM v0.5.0-dev+1085-g52397aaa0
> vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 20 2021 22:47:34)
Included patches: 1-2380
Problem / Steps to reproduce
When the sink function calls fzf#run()
, vim and neovim switch to normal mode instead of terminal mode.
This regression comes from this commit: https://github.com/junegunn/fzf/commit/1a76bdf8914195ab26ebac7e49a3ed8752dd69bd
minimal_vimrc:
call plug#begin('~/.vim/plugins')
Plug 'junegunn/fzf', {'dir': '~/.fzf','do': './install --all'}
call plug#end()
testcase.vim:
function! s:list_handler(...) abort
call s:run_testcase()
endfunction
function! s:run_testcase() abort
let opts = {'sink*': function('s:list_handler')}
call fzf#run(fzf#wrap(opts))
endfunction
call s:run_testcase()
Steps to reproduce the issue:
- nvim -u minimal_vimrc
- source testcase.vim
- press Enter
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- fix: command execution stalling until next key See https://github.com/junegunn/fzf/issues/2352 — committed to antoinemadec/coc-fzf by antoinemadec 3 years ago
- Add feedkeys for fzf workaround REF: https://github.com/junegunn/fzf/issues/2352 — committed to yuki-yano/fzf-preview.vim by yuki-yano 3 years ago
- Fix feedkeys() side effects See #2352 — committed to antoinemadec/fzf by antoinemadec 3 years ago
- [vim] Call feedkeys only when the destination buffer is a terminal Fix #2352 Fix https://github.com/junegunn/fzf.vim/issues/1216 Close #2364 — committed to junegunn/fzf by junegunn 3 years ago
- [vim] Force redraw by exiting and re-entering terminal mode Workaround for Neovim v0.5.0-dev https://github.com/junegunn/fzf/issues/2352#issuecomment-782894123 — committed to junegunn/fzf by junegunn 3 years ago
- refactor: remove feedkeys() workaround as FZF is fixed See https://github.com/junegunn/fzf/issues/2352#issuecomment-783350629 — committed to antoinemadec/coc-fzf by antoinemadec 3 years ago
- [vim] Stay in terminal mode if fzf#run is called from sink Fix #2352 — committed to kralicky/fzf by junegunn 3 years ago
- [vim] Call feedkeys only when the destination buffer is a terminal Fix #2352 Fix https://github.com/junegunn/fzf.vim/issues/1216 Close #2364 — committed to kralicky/fzf by junegunn 3 years ago
- [vim] Force redraw by exiting and re-entering terminal mode Workaround for Neovim v0.5.0-dev https://github.com/junegunn/fzf/issues/2352#issuecomment-782894123 — committed to kralicky/fzf by junegunn 3 years ago
I was able to reproduce the problem on Neovim HEAD (but not on Neovim 0.4.4 release). 29851c18aa47ad4b4cbf92358cfbe11935f0c033 will fix it.
@junegunn note that this commit created a weird condition where some commands executed after wait for a key to be pressed to be executed.
The minimal testcase I found is using CocList.
CocList extensions
won’t execute before we press a key:I had to
call feedkeys('', 'x')
before invokingCocList extension
to fix it.Can you test if this patch fixes the problem?