antoinemadec / coc-fzf

fzf :heart: coc.nvim
390 stars 28 forks source link

CocList fallbacks either insert a redundant 'i' or leave vim in insert mode #93

Closed Frederick888 closed 3 years ago

Frederick888 commented 3 years ago

Environment

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.4_1/share/nvim"

Run :checkhealth for more info


# Describe the Bug
Some lists at the moment redirects to CoC's built-in `CocList`.

If I use such a list from `CocFzfList` (without arguments, then choose from the pop-up), either a redundant `i` is inserted into the fuzzy search bar, or after Esc it leaves vim in insert mode.

# To Reproduce
## **Minimal** vimrc
```vim
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath

" vim-plug
call plug#begin()

Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'antoinemadec/coc-fzf', { 'branch': 'release' }

call plug#end()

Steps to Reproduce

  1. nvim -u minimal_vimrc
  2. :CocFzfList
  3. Choose a list like folders

Expected Behavior

No redundant i and after ESC Vim should be in normal mode.


Commenting out https://github.com/antoinemadec/coc-fzf/blob/3c8ca6127af51768cad8ff1074db5a9713d7fe13/autoload/coc_fzf/lists.vim#L70 seems to fix the problem for me. Now both lists with native coc-fzf support (e.g. commands) and non-natives (e.g. folders) work normally. Not sure if this is the root reason though.

antoinemadec commented 3 years ago

Fzf has changed recently and it is probable that the enter_term_mode() hack is not needed anymore on neovim 0.4.4.

I will remove it in the next few days.