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

Fix uncommenting with irregular white spaces. #82

Merged
merged 1 commit into from
Oct 10, 2017
Merged

Fix uncommenting with irregular white spaces. #82

merged 1 commit into from
Oct 10, 2017

Conversation

chaoren
Copy link
Contributor

@chaoren chaoren commented Dec 22, 2016

Allow stripping white spaces on the left and right independently.
Also, make sure the stripping is not reverted by subsequent lines
which do have white spaces.

The following cases were broken and is now fixed:

Before this change:

1. ^//foo$    -> ^oo$
   ^// bar$      ^bar$
2. ^/*foo */$ -> ^foo $
3. ^/* foo*/$ -> ^/* /1* foo*/ */$

After this change:

1. ^//foo$    -> ^foo$
   ^// bar$      ^ bar$
2. ^/*foo */$ -> ^foo$
3. ^/* foo*/$ -> ^foo$

@chaoren
Copy link
Contributor Author

chaoren commented May 22, 2017

Ping? The above issues are still present.

@tpope
Copy link
Owner

tpope commented May 22, 2017

I think the correct behavior for 1 should be

^foo$
^ bar$

Otherwise, you end up munging

//if (condition)
//  action();

@chaoren
Copy link
Contributor Author

chaoren commented May 22, 2017

Yes, of course. The patch does the right thing though, I just edited the message incorrectly, since it's been a while.

Allow stripping white spaces on the left and right independently.
Also, make sure the stripping is not reverted by subsequent lines
which do have white spaces.

The following cases were broken and is now fixed:

Before this change:

1. ^//foo$    -> ^oo$
   ^// bar$      ^bar$
2. ^/*foo */$ -> ^foo $
3. ^/* foo*/$ -> ^/* /1* foo*/ */$

After this change:

1. ^//foo$    -> ^foo$
   ^// bar$      ^ bar$
2. ^/*foo */$ -> ^foo$
3. ^/* foo*/$ -> ^foo$
@chaoren
Copy link
Contributor Author

chaoren commented Oct 9, 2017

Ping.

@tpope tpope merged commit 89f43af into tpope:master Oct 10, 2017
@chaoren
Copy link
Contributor Author

chaoren commented Oct 10, 2017

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants