ultisnips
ultisnips copied to clipboard
wrong cursor position
I asked the problem at coc-issue firstly.
I thought this could caused by my snippet? And the output of :verbose imap <tab>
shows
<Tab> * <C-R>=UltiSnips#ExpandSnippet()<CR>
~/.config/nvim/plugged/ultisnips/autoload/UltiSnips/map_keys.vim line 61
Aftre I updated all my vim plugs and changed python verson to 3.8 recently. Tab doesn's works fine.
![161675283-11f6b219-9bdf-40b5-9161-15cceb2473fe](https://user-images.githubusercontent.com/53030987/161676999-9c50d041-31df-4231-af78-a2c5e201bfdc.png)
![161675314-87e01cf9-a8ca-4c99-9528-96f3db38be60](https://user-images.githubusercontent.com/53030987/161677016-c2112799-bda9-4834-ac93-1b67650f4a1c.png)
Then I press Tab
, and I got this
![161675330-92449f2e-9c3d-4cc5-98f3-87303a5cc52a](https://user-images.githubusercontent.com/53030987/161677063-369eab24-3c36-4710-890d-ca180f8ba062.png)
Snippets I defined by myself also has same behavior.
snippet cn
const int ${1:variable} = ${0:number};
endsnippet
After I changed $0
to $2
, It works fine.
snippet cn
const int ${1:variable} = ${2:number};
endsnippet
Seems many snippets have this issue
![截屏2022-04-05 12 56 00](https://user-images.githubusercontent.com/53030987/161681682-651bdb40-5e18-4daa-9937-7cf4fce3f1f5.png)
![截屏2022-04-05 12 53 56](https://user-images.githubusercontent.com/53030987/161681418-17aaca40-0411-4efe-9f5d-cb933f790fe2.png)
After press Tab
![截屏2022-04-05 12 54 40](https://user-images.githubusercontent.com/53030987/161681550-613db5f6-43d1-4f6a-b5ac-4efed0928a46.png)
I have same issue sometimes. Does it happen to you every time? If not, I think it is not problem of UltiSnips.