zbirenbaum / copilot.lua

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

fix(suggestion): virtual text flicker #131

Closed MunifTanjim closed 1 year ago

MunifTanjim commented 1 year ago

Resolves https://github.com/zbirenbaum/copilot.lua/issues/130

uxfion commented 1 year ago

https://github.com/zbirenbaum/copilot.lua/issues/130#issuecomment-1441895703

it shows the following error

Error executing vim.schedule lua callback: ...e/pack/packer/opt/copilot.lua/lua/copilot/suggestion.lua:190: attempt to perform arithmetic on a nil value
stack traceback:
        ...e/pack/packer/opt/copilot.lua/lua/copilot/suggestion.lua:190: in function 'update_preview'
        ...e/pack/packer/opt/copilot.lua/lua/copilot/suggestion.lua:254: in function 'handler'
        ...w/Cellar/neovim/0.8.3/share/nvim/runtime/lua/vim/lsp.lua:1383: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
MunifTanjim commented 1 year ago

Pushed a fix... how about now? 🤔

uxfion commented 1 year ago

it works! 🍻

but it still flicker in accept_word I'm not quite sure if it appears in accept_line, because it doesn't show up

https://user-images.githubusercontent.com/44778029/220947939-03a534e4-d8b7-4b7d-be32-be6eac14d143.mov

MunifTanjim commented 1 year ago

Trying to fix it for accept_word is causing other issues. Note that copilot.vim does not support accept_word or accept_line. We just implemented a hacky patch to make it work.

Merging this fix for now.

uxfion commented 1 year ago

Thank you for your time and efforts🍺, I really love this project. Have a nice day!⛅️