Open unphased opened 1 year ago
Alright I wanna say that I solved this 90% satisfactorily via https://github.com/hrsh7th/nvim-cmp/discussions/1685
But I will leave this ticket open for now in order to continue fishing for ideas to make it better. Basically the solution is to detect whenever snippy is still active, and simply cause cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
to be run instead of the default which allows for bypassing the root problem while not making it much worse in experience.
What I like about it is that it lets me keep the default cmp.SelectBehavior.Insert
when a snippet context isn't active, which is most of the time.
The issue only occurred when using cmp's custom completion menu. Mirroring the tabstop seemed to reset the menu.
The solution I found was to check the visibility of the menu (cmp.visible()
) and only perform the mirroring if it is not visible. Please let me know if this still does not work for you.
Thanks. As you can see in my follow up comment, I found a way to do pretty much almost exactly what you describe via cmp bind function logic.
I don't think having both would be detrimental but I'll try to mess around with it more when I get a chance. Thanks.
Description
I was testing with my standard console.log snippet:
When "fancy" snippets like this are being used, interactions are poor with the cmp menu.
Steps to Reproduce
l
to type l. the snippet shows in cmp list<tab>
to move cmp selection down tol
snippet<cr>
to expand thel
snippet. snippy interaction starts here.ab
loads up cmp completion list filled withab...
entries<tab>
move the selection down to the first of theab...
entriesTypically at this point, cmp selection causes the first result to fill into buffer, e.g.
abcd
. This does happen, and snippy picks it up! Which is great. What happens to cmp's currently-open completion menu, however, isn't great.Expected Result
Expect cmp's completion list not to be clobbered
Actual Result
cmp's completion list gets clobbered at this point. it was listing the full list of
ab...
symbols but once the complex snippet expansion happens in response to cmp filling the current tabstop, the completion list now only shows this only one that matchesAdditional Context
No response