antoinemadec / coc-fzf

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

coc-fzf fails to work with builtin functions (coc-definition, cic-implementations etc) when g:fzf_preview_window is set to [] #83

Closed smypf closed 3 years ago

smypf 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/share/nvim"

Run :checkhealth for more info


# Describe the Bug
When disabling the preview window with `let g:fzf_preview_window = []` as described in the fzf manual the functionality no longer works, defaulting back to default behaviour.

# To Reproduce
## **Minimal** vimrc
```vim
call plug#begin('~/.config/nvim/plugged')

Plug 'junegunn/fzf', {'dir': '~/.fzf','do': './install --all'}
Plug 'junegunn/fzf.vim' " needed for previews
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
Plug 'antoinemadec/coc-fzf'

call plug#end()

" Empty value to disable preview window altogether
" Commenting out this line restores the expected behaviour
let g:fzf_preview_window = []

nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

Steps to Reproduce

  1. nvim -u minimal_vimrc
  2. :e myfile.tsx
  3. Attempt to view references of any function using gr

Expected Behavior

The references must be shown in a fzf window without a file preview.

antoinemadec commented 3 years ago

@smypf , thanks for the report. I did not think someone would want the location lists (reference, definition etc) through FZF without the preview. This is however a completely valid use case. It should work just fine now 😃

Please let me know if you encounter further issues.

smypf commented 3 years ago

Thanks for taking the time to fix this @antoinemadec. I really like the interface that coc-fzf presents results in and the ease of using it over the standard implementation.

In regards to my usage when looking for a reference I want to find where it is in a particular file so the preview is unnecessary. I also don't like it since I think it adds visual clutter.