Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline completion does not disappear, although I select a suggestion. #100

Open
kkang831 opened this issue Aug 3, 2023 · 5 comments
Open

Comments

@kkang831
Copy link

kkang831 commented Aug 3, 2023

I'm currently using both youcompleteme and tabnine. When I type 'np.' like in the first image, two suggestions pop up. Even though I select 'abs' by pressing the down arrow key, the inline completion does not disappear as shown in the second image. This is a minor inconvenience, but is there a quick fix for this issue?
img1
img2

@aarondill
Copy link
Contributor

You're in luck, actually. I've already done the work to implement a fix for this over at #70 which is just waiting to be reviewed and merged. I'd greatly appreciate a few more eyes / people showing support on it to get finished 😃

@aarondill
Copy link
Contributor

As a temporary workaround, you could just copy the function from lua/tabnine/keymaps.lua (with the necessary requires) and put it in your mapping

@kkang831
Copy link
Author

kkang831 commented Aug 3, 2023

Oh, I got lucky. Thank you. I'll try it in my environment. I hope it gets merged quickly.

@kkang831
Copy link
Author

kkang831 commented Aug 3, 2023

I'm not familiar with neovim, so I want to make sure I've executed it properly.

First, I applied all the changes from the commit to my environment.
Next, I wanted to write the following in my neovim init file.
-- Call tabnine
if not require("tabnine.keymaps").accept_suggestion() then
-- tabnine didn't have a suggestion, use cmp for completion
cmp.mapping.confirm({ select = false })(fallback)
end

However, since I don't use cmp but use youcompleteme, it seems not to work for me.

@aarondill
Copy link
Contributor

I'm not sure if there's a way to force accept a ycm suggestion, having done a little searching, I couldn't find one, but I also don't use ycm.
If you can find it, you would replace the cmp part above with it.

Additionally, if you can hook into ycm's action on accepting a suggestion, you would then call dismiss_suggestion to hide the Tabnine suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants