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

do not remove too many chars on uncommenting #93

Closed
wants to merge 1 commit into from

Conversation

chrisbra
Copy link

If the text is not consistently commented like this:

using gcc will remove the leading - on the first line.

That is, because in the first for loop, the l will be set to not include
the leading slash, however after the first iteration, it will be
overwritten and contain '# ' (e.g. 2 chars). Then on uncommenting,
the first two characters will be unconditionally removed.

Fix this, by remembering the shortest match to remove.

references #92

@chrisbra
Copy link
Author

updated to latest changes

If the text is not consistently commented like this:

#- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
#  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
#  nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
#  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
#  fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
#  culpa qui officia deserunt mollit anim id est laborum.

using gcu will remove the leading - on the first line. (`:set cms=#%s`)

That is, because in the first for loop, the l will be set to not include
the leading slash, however after the first iteration, it will be
overwritten and contain '# ' (e.g. 2 chars). Then on uncommenting,
the first two characters will be unconditionally removed.

Fix this, by remembering the shortest match to remove.

references tpope#92
@tpope
Copy link
Owner

tpope commented Oct 31, 2022

#82 appears to have fixed this.

@tpope tpope closed this Oct 31, 2022
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