Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omni complete exits abnormal under NeoVim #310

Closed
taoso opened this issue Feb 17, 2016 · 5 comments
Closed

omni complete exits abnormal under NeoVim #310

taoso opened this issue Feb 17, 2016 · 5 comments

Comments

@taoso
Copy link

taoso commented Feb 17, 2016

If I edit some file under git, and use omnifunc to open a completion list, NeoVim will automatically use the first item and exit the completion if and only if the item has an info attribute which will let vim open an preview window to display.

I think this commit 18b7836 is the bad boy.

By the way, this problem will disappear if I add let g:gitgutter_eager = 0 to my vim config.


How to reappear?

function OmniDemo(findstart, base)
       if a:findstart > 0
              return 0
       endif
       return [{'word':'word1', 'info':'info1'},{'word':'word2', 'info':'info2'}]
endfunction
set omnifunc=OmniDemo

Edit any file under git, use ctrl_x ctrl_o to complete, and you will only get the word1.

@airblade
Copy link
Owner

Hmm, #305 also relates to completion. I wonder if they are related.

@chemzqm
Copy link

chemzqm commented Feb 20, 2016

I just figured it out, neovim would trigger BufEnter for the preview window, and it would has some problem with the function gitgutter#process_buffer, I have to use let g:gitgutter_eager=1 to avoid the function call.

It should be a bug of neovim, BufEnter event should not be triggered when using complete with preview window.

@Shougo
Copy link

Shougo commented Feb 20, 2016

This is neovim bug? If so, you should create new issue in neovim.

@Shougo
Copy link

Shougo commented Feb 20, 2016

I think it is not neovim/Vim bug. It is feature.
Because, to create preview window, Vim/neovim creates new preview window buffer [preview]. BufEnter is occurred.
vim-gitgutter should ignore BufEnter in the preview window.

@chemzqm
Copy link

chemzqm commented Feb 20, 2016

@Shougo you're right, both vim and neovim triggered the BufEnter event, but neovim can't works with function gitgutter#process_buffer. The buffer trigger BufEnter is not the preview buffer, but the current buffer, and I found we can check pumvisible to avoid the function call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants