liuchengxu / vista.vim

:cactus: Viewer & Finder for LSP symbols and tags
https://liuchengxu.github.io/vista.vim
MIT License
1.9k stars 87 forks source link

Popup window closes itself #149

Closed crmtestresco closed 5 years ago

crmtestresco commented 5 years ago

Describe the bug Popup window with preview of surroundings of selected method (Typescript code) closes itself without performing any action/movement after cca 1s. This behavior does not manifest itself on e.g. variables.

Possible hints:

Environment:

Vista info

    Current FileType: vista_kind
Avaliable Executives: ['coc', 'ctags', 'ale']
    Global Variables:
    let g:vista#executives = ['ale', 'coc', 'ctags', 'lcn', 'vim_lsp']
    let g:vista#finders = ['fzf', 'skim']
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#enable_icon = 1
    let g:vista#renderer#icons = {'subroutine': '羚', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '', 'interface': '', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': 'פּ', 'fields': '', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'variable': '', 'modules': '', 'constant': '', 'struct': '', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': '鬒'}
    let g:vista_blink = [0, 0]
    let g:vista_cursor_delay = 1000
    let g:vista_default_executive = 'coc'
    let g:vista_echo_cursor_strategy = 'floating_win'
    let g:vista_floating_delay = 100
    let g:vista_top_level_blink = [0, 0]

Steps to reproduce given the above info

  1. Open Vista window using :Vista!!
  2. Move to method name using standard vim navigation keys j,k
  3. Popup window with method preview shows
  4. Popup window closes itself without any interaction after cca 1s

Expected behavior Popup window stays open until the cursor is moved from the method.

Actual behavior Popup window closes automatically without moving away from the method.

Thank you for creating this plugin.

liuchengxu commented 5 years ago

I can't reproduce your issue locally, but did find a bug in popup :(. Please provide a minimal vimrc if your problem persists.

crmtestresco commented 5 years ago

Hi,

this is minimum .vimrc I can reproduce the bug with:

let g:pathogen_disabled = ['FastFold' , 'ale' , 'argtextobj.vim' , 'fzf' , 'fzf.vim' , 'goyo.vim' , 'haskell-vim' , 'limelight.vim' , 'setcolors.vim' , 'ultisnips' , 'undotree' , 'vim-airline' , 'vim-colorschemes' , 'vim-commentary' , 'vim-easymotion' , 'vim-expand-region' , 'vim-fugitive' , 'vim-gutentags' , 'vim-livedown' , 'vim-qf' , 'vim-repeat' , 'vim-ripgrep' , 'vim-sensible' , 'vim-signjump' , 'vim-sleuth' , 'vim-snippets' , 'vim-stay' , 'vim-surround' , 'vim-textobj-function' , 'vim-textobj-function-javascript' , 'vim-textobj-user' , 'vim-unimpaired' , 'vim-wordmotion' , 'vim-workspace']

call pathogen#infect()

filetype plugin indent on

" Vista plugin configuration
let g:vista_default_executive = 'coc'
let g:vista_cursor_delay = 1
let g:vista_floating_delay = 1
let g:vista_echo_cursor_strategy = 'floating_win'

I also noticed that with this config:

liuchengxu commented 5 years ago

I can reproduce with the following vimrc in vim and I believe it's an issue of coc.nvim. If you disable coc.nvim via :CocDisable, the symptom disappears. If you enable it again via :CocEnable, the issue occurs.

set nocompatible

let $DOTVIM = expand('$HOME/.vim')

set runtimepath+=$DOTVIM/plugged/vista.vim
set runtimepath+=$DOTVIM/plugged/coc.nvim

filetype plugin indent on

" Vista plugin configuration
let g:vista_default_executive = 'coc'
let g:vista_cursor_delay = 1
let g:vista_floating_delay = 1
let g:vista_echo_cursor_strategy = 'floating_win'

After some investigation, I think this line is related https://github.com/neoclide/coc.nvim/tree/5380d3639671d1e11949a41daea735da7cf1f0c5/plugin/coc.vim#L208 . This autocmd leads to the unexpected close.