Replies: 1 comment
-
Yeah.
works. Here's my relevant mapping logic which may be helpful to anyone in the same boat.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
See the writeup I did here: dcampos/nvim-snippy#116
Basically when you have a snippet (even a simple one) that references one of the tabstops, e.g. the following snippet:
console.log("$1", $1)
what happens with cmp and the snippet engine is that as you use the cmp completion menu to select an item, the instant it's selected, cmp fills it into the buffer, which in turn causes the snippet engine to fill in the second instance of $1, which in turn presumably requires the cursor to move, which presumably causes cmp to clobber its understanding of which characters you've typed (now thinking that the completion that got selected became actually fully typed in).
Hopefully an elegant workaround exists for this. I worry that the limitation is in cmp's side and the same issue will exist no matter what snippet engine is used.
I suspect that using
cmp.SelectBehavior.Select
instead ofcmp.SelectBehavior.Insert
may address this but I don't want to have to add another keystroke.Maybe the answer that will be mildly satisfactory will be to query snippet engine during this logic and only use the Select mode when a snippet is active.
Beta Was this translation helpful? Give feedback.
All reactions