Closed mbenford closed 2 years ago
OK, I did more testing and realized it has nothing to do with gopls
: it's the file indentation that causes the problem. It stops happening when I disable expandtab
so spaces are used instead of tabs.
I also noticed that by changing tabstop
(with expandtab
off) to different values the cursor is placed at different positions after a suggestion is selected.
I think I see what's going wrong, virtualedit
makes it so every individual column of a tab has to be moved over, the one <right>
we do for the entire tab isn't enough.
I'll definitely look into that one, thank you for opening this👍
I have recently migrated from vim-snip to LuaSnip (paired with nvim-cmp) and I noticed a strange behavior when completing suggestions from
gopls
withvirtualedit=all
. I guess ~an image~ a gif is worth a thousand words:That doesn't happen with other language servers, as far as I can tell (I've tested it with
tsserver
andsumneko
).The behavior shown in the gif above can be reproduced with the following configuration:
I'm not sure whether this is a bug in LuaSnip or nvim-cmp, but since it works correctly when using vim-snip, I think it might be something with LuaSnip.