Wrong cursor position for some snippets sometimes
Given the following snippet:
{
"if": {
"prefix": ["if"],
"body": [
"if (${1})",
"{",
"\t${TM_SELECTED_TEXT}$0",
"}"
]
}
}
If this snippet is expanded, the cursor (which I will indicate as ^) sometimes ends up here if (^) (as expected) but most times it ends up here: if ()^.
I tried to reproduce this in vanilla vim with just the vsnip plugin, but it behaved correctly in this case, so it could be related to my config
I thought it might be related to the popup menu, but it doesn't seem to matter whether this is open or not
My current workaround is to use this instead which doesn't have the issue:
"if": {
"prefix": ["if"],
"body": [
"if (${1: })",
"{",
"\t${TM_SELECTED_TEXT}$0",
"}"
]
},
Hm... In my environment, the problem does not reproduce...
Could you try to detect dependent plugin or tell the list of all plugins?
In this case, vsnip invoke s:Session.move but its very simple...
https://github.com/hrsh7th/vim-vsnip/blob/master/autoload/vsnip/session.vim#L177
Ok I'll try narrowing it down some more by slowly removing plugins
Could you test with latest vsnip?
Ok this appears to be fixed now. I reproduced it quite easily before updating but afterwards I can't reproduce it again. Thanks!
False alarm :| I'm seeing it again despite being up to date
Thank you. Hm... it',very weird.