lingering ghost text
Ghost text is left behind on screen and not cleared when in normal mode (think this might have something to do with smart/auto indentation). To reproduce this error edit a piece of text that has multiple indentation levels, press o to insert on next line, wait for suggestion to appear, press esc to go normal mode, press I for insert mode, wait for ghost text to appear, then press backspace once to delete, now your cursor will be on previous line, press esc and there will be ghost text left behind on screen
Thank you I was able to replicate it :)
Went to work on this and I cannot seem to replicate it anymore. I am starting to think it was an issue on the LSP side that got resolved in an update 🤷♂️ If you update to the latest version are you able to replicate it?
Went to work on this and I cannot seem to replicate it anymore. I am starting to think it was an issue on the LSP side that got resolved in an update 🤷♂️ If you update to the latest version are you able to replicate it?
Update to latest copilot plugin? I'm on the latest commit rn and still able to reproduce the error, it's actually gotten worse for me lol, the ghost text somehow turned actually syntax highlighted ghost text, but when I redraw the screen the text goes away. Btw this issue happens when expandtab is set to false, if expandtab is true this issue doesn't happen to me.
I am also seeing this
I can replicate that virtual text will not go away when exiting insert with C-c during a suggestion
Same here. Rebinding C-c so that it also dismisses the current suggestion before exiting insert mode seems to be one possible workaround:
local copilot_suggestion = require("copilot.suggestion")
vim.keymap.set('i', '<C-c>', function()
if copilot_suggestion.is_visible() then
copilot_suggestion.dismiss()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'n', true)
else
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'n', true)
end
end, { noremap = true, silent = true, desc = "Dismiss Copilot suggestion and exit insert mode" })
One guess why C-c is an issue (and not regular escape) is because C-c does not trigger the InsertLeave autocommand event which is probably what's used to clean up the ghost text.
I also see this (not using C-c).
@greywolve yeah C-c is an 'abort' keymap so a lot of plugins probably have problems with it. @boborbt do you have instructions as to how to replicate it? I have been unable to replicate this based on the original steps for a while now.
@greywolve yeah C-c is an 'abort' keymap so a lot of plugins probably have problems with it. @boborbt do you have instructions as to how to replicate it? I have been unable to replicate this based on the original steps for a while now.
here's a video, if you have vim.opt.expandtab = false this will happen following the steps I originally mentioned
Awesome the expandtab was the missing link!
Well that was one hell of an investigation. Turns out it's a bug in NeoVim with the inline extmarks. I have created an issue and will update this when resolved.
Looks like control chars are not supported with inline extmarks, I have added a workaround which seems to resolve it.