Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected cursor position when using i_CTRL-o to add surroundings #67

Open
kiryph opened this issue Jul 9, 2018 · 3 comments
Open

Comments

@kiryph
Copy link

kiryph commented Jul 9, 2018

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:
tpope/vim-surround#253

@machakann
Copy link
Owner

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
Copy link
Owner

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

@bew
Copy link

bew commented Feb 18, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants