Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
4.3k stars 157 forks source link

How do I detect that the virtual text is currently visible? #124

Closed nyngwang closed 1 year ago

nyngwang commented 1 year ago

As title. What I want to achieve is that if it's not visible then I will call codeium#Complete, otherwise codeium#Accept is called.

pqn commented 1 year ago

I don't think any variable perfectly tracks the rendering right now. In a few places we do s:GetCurrentCompletionItem() which tells you if a completion applies to the current text I guess, and you can also see the code for clearing completions in s:ClearCompletion(). Maybe with those you can piece together what you need.

Shougo commented 1 year ago

It may help.

https://github.com/Exafunction/codeium.vim/issues/142#issuecomment-1550463853