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

Wrapping entire line behaves other than surround.vim #5

Closed
cofi opened this issue Jan 22, 2012 · 4 comments
Closed

Wrapping entire line behaves other than surround.vim #5

cofi opened this issue Jan 22, 2012 · 4 comments

Comments

@cofi
Copy link
Contributor

cofi commented Jan 22, 2012

I'm currently working on some patches, one would add a documentation.
I draw on the examples from surround.vim and there isyssb on this line:

 { Hello } world!

The expected would be

 ({ Hello } world!)

but it is (make emacs on the latest evil)

(
 { Hello } world!
   )

I'm not sure if the problem lies with evil's sentence (line?) text object or evil-surround but since I can only think of surround to reproduce this I'll submit it here.

@timcharper
Copy link
Collaborator

Hmm, I'm not even sure where to begin with this one. It's probably a quirk in evil's text objects, since evil-surround uses them to find surround points.

@ghost
Copy link

ghost commented Jan 30, 2012

I had a quick look at surround's code. If I understand correctly, then yss calls surround-region with a motion generated by evil-line. evil-line is a linewise motion, thus the region passed surround-region has "beg" as the first character in the first line of that region and end as the first character after the newline character of the last selected region, so that the region matches exactly the selected lines.

surround-region seems to handle 'line type motions by putting the surrounding tags on a new line before and after the region. I think the best solution would be to handle line-wise motions for surrounding tags like (...) or [...] differently and not inserting newlines but the opening tag before the first non-blank on the first line and the closing tag behind the last non-blank on the last line.

@ghost ghost mentioned this issue Nov 1, 2012
@blaenk
Copy link

blaenk commented Feb 5, 2016

This can be closed it seems.

@timcharper
Copy link
Collaborator

Fixed with 8b2ca83

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