vim-sandwich icon indicating copy to clipboard operation
vim-sandwich copied to clipboard

Unexpected cursor position when using i_CTRL-o to add surroundings

Open kiryph opened this issue 7 years ago • 3 comments

Right now vim-sandwich does not return to the desired cursor position in following example.

Current behavior:

word| Ctrl-o ysiw' positions the cursor as following: '|word'

Expected behavior:

word| Ctrl-o ysiw' should position the cursor as following: 'word'|

| denotes the cursor position. I am using the vim-surround mappings described in the documentation.

I came across this issue on the vim-surround issue tracker: https://github.com/tpope/vim-surround/issues/253

kiryph avatar Jul 09 '18 06:07 kiryph

Good catch, thank you! I reproduced the problem. It seems different if not using vim-surround style mapping.

I will check it in this weekends

machakann avatar Jul 10 '18 14:07 machakann

It seems difficult to fix this currently. The current behavior is correct in normal mode. Thus, we need to implement different logic for cursor placement.

The problem is there is no way to realize the use of Ctrl-o inside a script. Probably, we need this patch. vim/vim#3000

machakann avatar Jul 16 '18 07:07 machakann

Hello! Just a friendly ping as the patch you mentionned in your last message has been merged

bew avatar Feb 18 '20 01:02 bew