yami-beta / asyncomplete-omni.vim

Omni completion source for asyncomplete.vim
MIT License
39 stars 11 forks source link

Popup menu not showing in Vim 8 #18

Closed mcesar closed 4 years ago

mcesar commented 4 years ago

After #17, the popup menu is not showing in vim 8 anymore. The problem is the reversion of #3, and an elseif in line 39 of omni.vim instead of an else. The fix for this problem is as follows:

diff --git a/autoload/asyncomplete/sources/omni.vim b/autoload/asyncomplete/sources/omni.vim
index b5900db..e86d181 100644
--- a/autoload/asyncomplete/sources/omni.vim
+++ b/autoload/asyncomplete/sources/omni.vim
@@ -24,7 +24,7 @@ function! asyncomplete#sources#omni#completor(opt, ctx) abort
     endif
     let l:base = l:typed[l:startcol : l:col]
     let l:matches = s:safe_omnifunc(0, l:base)
-    call asyncomplete#complete(a:opt['name'], a:ctx, l:startcol, l:matches)
+    call asyncomplete#complete(a:opt['name'], a:ctx, l:startcol + 1, l:matches)
   catch
     call asyncomplete#log('omni', 'error', v:exception)
   endtry
@@ -36,7 +36,7 @@ function! s:safe_omnifunc(...) abort
   try
     if &omnifunc == 'v:lua.vim.lsp.omnifunc'
       return v:lua.vim.lsp.omnifunc(a:1, a:2)
-    elseif
+    else
       return call(&omnifunc, a:000)
     endif
   finally