hrsh7th / vim-vsnip-integ

vim-vsnip integrations to other plugins.
MIT License
128 stars 16 forks source link

Remove v:completed_item after use #48

Closed hrsh7th closed 3 years ago

hrsh7th commented 3 years ago

Fixes #46

jandamm commented 3 years ago

Unfortunately this does not fix the issue for me. The CompleteDone autocommand will set the v:completed_item again. It seems to be triggered once when the completion is accepted and again when the next completion is requested.

hrsh7th commented 3 years ago

Hm... It's weird... I get the correct behavior with this patch.

https://user-images.githubusercontent.com/629908/132692041-28dc383f-4d1a-4383-834e-00b03b43e4b4.mp4

jandamm commented 3 years ago

Here is my issue with your fix: https://user-images.githubusercontent.com/5963139/132695035-6c23a3c8-3899-4cba-aa74-2cbc021f31ea.mp4

Here is my issue with my fix: https://user-images.githubusercontent.com/5963139/132695117-31240520-5ed7-48d0-8350-423f8b246731.mp4

I also noticed the issue you showed in the second part of your video but weren't able to reproduce it with my fix either.

hrsh7th commented 3 years ago

Thank you. I've fixed.

jandamm commented 3 years ago

I can only test later. Could you share your config of vimls? Since you're not seeing the ${0 after the completion it seems you have different configuration.

hrsh7th commented 3 years ago

@jandamm Because I'm working on it :) https://github.com/neovim/neovim/pull/15579

It's neovim's bug.

jandamm commented 3 years ago

This fixes the bug described above, but not another issue I had with another lsp (sourcekit-lsp), which I'm not able to produce with vimls.

I'm always typing: try Rul<C-x><C-o>(<C-x><C-o><CR> which should result in try Rule(name: String, pattern: String, template: String

Here is the behavior without the fix: https://user-images.githubusercontent.com/5963139/132736754-b9cd3f19-7ce8-4edd-be2a-c5c56a2c002e.mp4

Here is the behavior with #48 - here I typedtry Rul<C-x><C-o>(<C-x><C-o>(<C-x><C-o><CR>: https://user-images.githubusercontent.com/5963139/132737073-3b3b9571-9f78-4b1e-9bd3-a0c1bf96c667.mp4

Here is the behavior with #47 - which is as expected: https://user-images.githubusercontent.com/5963139/132737290-221cc936-33bd-43cc-af62-67ccc60bf3dc.mp4

Somehow the CompleteDone is triggered twice for Rule.