ultisnips
ultisnips copied to clipboard
Wrong final cursor position in nested auto-trigger snippets
Let these be tex.snippets
snippet mk "Math" iA
\($1\)$0
endsnippet
snippet xx "foo" iA
aha
endsnippet
snippet ** "foo" iA
aha
endsnippet
And these be .vimrc
let $PlugPath = '~/.vim/plugged'
call plug#begin($PlugPath)
Plug 'sirver/ultisnips'
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
Expected behavior:
When I press both mk**<tab>
and mkxx<tab>
, the cursor should be after ')'
Actual behavior:
When I press mkxx<tab>
, the cursor eventually stays on ')'.
When I press mk**<tab>
, the cursor goes after ')' as expected.
Steps to reproduce Put the three snippets above into tex.snippets and press the keys as discribed.
- Operating System: Manjaro Linux in wsl2
- Vim Version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 17 2020 21:54:53) 包含补丁: 1-1704
- UltiSnips Version: 7941f98337564d4e86cf2b7467b64def4d212794
- Python inside Vim: python3.8.5
- Docker repo/vimrc:
https://github.com/lervag/dotvim/blob/master/coc-settings.json fix the issue for me, don't know which line takes the effect.
Same issue here. I tried to put the coc-setting.json file in the .vim folder, but it still doesn't work.
Same issue here. I tried to put the coc-setting.json file in the .vim folder, but it still doesn't work.
You may not copy the whole file. Here's what in my coc-settings.json
{
"diagnostic.displayByAle": true,
"diagnostic.refreshAfterSave": true,
"suggest.enablePreview": true,
"suggest.minTriggerInputLength": 3,
"suggest.snippetIndicator": "[+] ",
"suggest.timeout": 1000,
"suggest.removeDuplicateItems": true,
"coc.source.ultisnips.enable": false,
"coc.preferences.useQuickfixForLocations": true
}
And I have coc-ultisnips installed. By the way, I Plug coc-nvim before ultisnips, maybe you can try it.
Thank you very much for your reply. However, I am using vim-snippet and Ultisnipet, not using coc-nvim. Unfortunately, this solution doesn't work for me.
Somehow this seems fixed in latest version of Ultisnips and coc.nvim, with latest configuration on https://github.com/neoclide/coc.nvim I'll do more test later then close this if really fixed.
The bug completely disappears now on my environment, I don't quite know why, maybe thanks to update of coc.nvim? Anyway, closing this. If someone run into same issue, I'm glad to share my configuration to you.