prabirshrestha / asyncomplete.vim

async completion in pure vim script for vim8 and neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multiple source eat key while displaying pum

mattn opened this issue · comments

commented

I'm using following asyncomplete sources.

Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'prabirshrestha/asyncomplete-file.vim'
Plug 'prabirshrestha/asyncomplete-emoji.vim'
Plug 'prabirshrestha/asyncomplete-tags.vim'

When I type keys quickly, vim eat some key. For example, I type printf quickly, pritf is inserted. After spending a bit of time to figureout, I found that multiple calls of complete while displaying pum caused this problem.

As proof, the following changes will solve this issue.

diff --git a/autoload/asyncomplete.vim b/autoload/asyncomplete.vim
index 403ce9c..3d95a6d 100644
--- a/autoload/asyncomplete.vim
+++ b/autoload/asyncomplete.vim
@@ -491,7 +491,9 @@ function! asyncomplete#preprocess_complete(ctx, items)
     endif
 
     call asyncomplete#log('core', 'asyncomplete#preprocess_complete calling complete()', a:ctx['startcol'], a:items)
-    call complete(a:ctx['startcol'], a:items)
+    if pumvisible() == 0
+      call complete(a:ctx['startcol'], a:items)
+    endif
 endfunction
 
 function! asyncomplete#menu_selected() abort

@prabirshrestha Will this change break the functionality of asyncomplete?

if i wanted to implement fuzzy search it would break. isn't it a bug in vim instead?

commented

I still not figure out whether caused by vim, asyncomplete or vim-lsp, but at least the other completion engines don't reproduce this. (as I've been told from others)

have u tried disabling text edit in vim-lsp and see if that helps. there was a recent regression which was fixed. wondering if there are more. i haven't been able to repro. prabirshrestha/vim-lsp#914

commented

Thanks. I tried to disable g:lsp_text_edit_enabled but not fixed.

commented

As far as I treid few times, let g:lsp_async_completion = 0 seems to be effective for fixing this issue.

commented

Sorry, I told a lie. it's not related.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.