I had this same request before. complete_info() should give this info. https://github.com/vim/vim/issues/4083
On Wednesday, January 15, 2020 at 1:10:34 PM UTC-8, Bram Moolenaar wrote: > > > Paul Jolly wrote: > > > We are using the CompleteDone event in govim > > (https://github.com/govim/govim) in order to add import statements > > when a user selects a completion candidate (this happens when > > completion candidates result from unimported completions in gopls). > > > > However our handler for CompleteDone needs to know whether the event > > has been triggered as part of an omni-complete (<C-x><C-o>) or a > > <C-x><C-n> completion (not sure if this has a specific name). > > > > There doesn't appear to be a way to distinguish however from the value > > v:completed_item. > > > > Are we missing something obvious here? > > I don't think there is a direct way to get the type of completion. > > You could perhaps use the CompleteChanged event and check for user_data > in the completed item. > > -- > The Characters and incidents portrayed and the names used are fictitious > and > any similarity to the names, characters, or history of any person is > entirely > accidental and unintentional. > Signed RICHARD M. NIXON > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES > LTD > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net > \\\ > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ > \\\ > \\\ an exciting new programming language -- http://www.Zimbu.org > /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org > /// > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/a0d22f15-16a9-414d-8031-aa16ce96920e%40googlegroups.com.
