zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.43k stars 64 forks source link

Stuck suggestion ghost on window change #268

Closed blauweb closed 4 months ago

blauweb commented 5 months ago

Hi,

If I change the window once a suggestion has appeared next to my cursor, a ghost of that suggestion stays in that line of code and doesn't go away until I reset vim.

Edit: The issue happens specifically when I switch the focus to a different window (inside nvim) by mouse, while in insert mode; this does not happen if I change focus to a different app, or if I exit insert mode first and then change the focus.

Environment: Ubuntu 22.04 Gnome 42 Neovim with Lazyvim.

image

MunifTanjim commented 4 months ago

Does this bug happen on 71382c2efec76647287d46a4fbe0ec8c9809e2ee?

I think some things might be broken because https://github.com/zbirenbaum/copilot.lua/pull/262 was merged without making necessary changes.

zbirenbaum commented 4 months ago

Does this bug happen on 71382c2efec76647287d46a4fbe0ec8c9809e2ee?

I think some things might be broken because https://github.com/zbirenbaum/copilot.lua/pull/262 was merged without making necessary changes.

262 just updated the copilot dist. The diff shows a postion being changed to position for that commit. Are they related?

If changes in the agent.js caused this then I'll de-obfuscate it and try to figure out the issue.

If there was a problem in the agent.js wouldn't there be way more complaints though? It's been working fine on my end.

MunifTanjim commented 4 months ago

I just meant that https://github.com/github/copilot.vim has other changes in these commits:

Since those were not ported over in copilot.lua, that could potentially cause issues.

That's why I asked if the same issue existed before merging #262 .

zbirenbaum commented 4 months ago

I just meant that https://github.com/github/copilot.vim has other changes in these commits:

Since those were not ported over in copilot.lua, that could potentially cause issues.

That's why I asked if the same issue existed before merging #262 .

Ah got it, I'll look those over and make any of the changes that are relevant.

blauweb commented 4 months ago

Thank you for your reply and interest in my issue. If I read your comment correctly, I do not think this is related to #262 , but I can't say for 100% sure, because I just started to find myself around vim in general, and the last couple of days are bit blurred to me in regards to which changes happened when.

Is there a way I can debug this to provide you with more useful input?

I have updated the description, to explain better when the issue arises.

Edit: I think I may be knocking at the wrong door. I think this may be more nvim-cmp related. I will look there and update here once I find out more. Suggestions from the autocomplete (not copilot related) also get stuck.

zbirenbaum commented 4 months ago

I just meant that https://github.com/github/copilot.vim has other changes in these commits:

Since those were not ported over in copilot.lua, that could potentially cause issues.

That's why I asked if the same issue existed before merging #262 .

I read through those commits and the changes probably don't require implementing on our end. There's a couple of housekeeping changes related to things like variable names, some edits/new messages for the logger, and one or two things that appear to be for debugging telemetry.

Edit: I think I may be knocking at the wrong door. I think this may be more nvim-cmp related. I will look there and update here once I find out more. Suggestions from the autocomplete (not copilot related) also get stuck.

This is very possible. Do you have ghost text enabled for nvim-cmp? Maybe there's some conflict with copilot ghost text and nvim-cmp ghost text trying to appear.

blauweb commented 4 months ago

The issues happens with every cmp suggestion, so I am ruling this plugin out as a source for the issue. I have raised this at the nvim-cmp repo, but the maintainer/s don't seem to have the bandwidth or interest in addressing the issue. So I am closing this. Much appreciated for you responsiveness!