Skip to content

Show suggestion even when pmenu is open, for use with other completion plugins? #62

@sj2tpgk

Description

@sj2tpgk

Hi,

Currently FIM suggestion isn't shown when pmenu (completion popup) is open.
Also, already shown suggestion is hidden when pmenu gets opened.

Thus I must cancel other completion plugin's pmenu to see llama.vim's suggestion.

Is it possible to:

  • show even when pmenu is open
  • do not hide when pmenu gets opened
  • hide only after the user selects an item from pmenu

Following patch makes it comfortable for me, but I'm not sure how others feel in their setup..

diff --git a/autoload/llama.vim b/autoload/llama.vim
index 573d2fd..b73cf26 100644
--- a/autoload/llama.vim
+++ b/autoload/llama.vim
@@ -174,7 +174,7 @@ function! llama#init()
         autocmd CursorMoved     * call s:on_move()
         autocmd CursorMovedI    * call s:on_move()

-        autocmd CompleteChanged * call llama#fim_hide()
+        autocmd CompleteChanged * if complete_info().selected != -1 | call llama#fim_hide() | endif
         autocmd CompleteDone    * call s:on_move()

         if g:llama_config.auto_fim
@@ -785,7 +785,7 @@ endfunction
 " render a suggestion at the current cursor location
 function! s:fim_render(pos_x, pos_y, data)
     " do not show if there is a completion in progress
-    if pumvisible()
+    if pumvisible() && complete_info().selected != -1
         return
     endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions