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

Surrounding multiple words #137

Closed
rightaway opened this issue Jul 12, 2014 · 3 comments
Closed

Surrounding multiple words #137

rightaway opened this issue Jul 12, 2014 · 3 comments

Comments

@rightaway
Copy link

Using latest version.

aaa bbb ccc ddd

ys2iw' when cursor is on middle c. Should show aaa bbb 'ccc ddd'.

aaa bbb 'ccc' ddd

ys2aw' when cursor is on middle c. Should show aaa bbb 'ccc ddd'.

aaa bbb' ccc ddd'

ys2iw' when cursor is on middle b. Should show aaa 'bbb ccc' ddd.

aaa 'bbb' ccc ddd

ys2aw' when cursor is on middle b. This is as expected.

aaa 'bbb ccc' ddd
@tommcdo
Copy link
Contributor

tommcdo commented Jul 12, 2014

Try these commands using v instead of ys (and, of course, omit the '). This is just how "inner" and "a" text objects with with counts.

@tommcdo
Copy link
Contributor

tommcdo commented Jul 12, 2014

Though it seems maybe surround.vim is detecting "unwanted" space and trimming it, but perhaps missing the edge case. Whitespace is trimmed when there is whitespace at the end of the target, but not when it's only at the beginning?

To demonstrate, using the same text, compare ysaw' with the cursor on c vs on d.

The edge case in question is that Vim will normally include trailing whitespace for the aw object unless it's the last word on the line, in which case it will include leading whitespace.

@tpope
Copy link
Owner

tpope commented Jul 15, 2014

Feel free to dig deeper on that edge case, but it sounds like the core problem is a non-issue.

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