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

Dash lost when removing comments #92

Closed
kurkale6ka opened this issue Aug 4, 2017 · 2 comments
Closed

Dash lost when removing comments #92

kurkale6ka opened this issue Aug 4, 2017 · 2 comments

Comments

@kurkale6ka
Copy link

Start with: (:se cms=#%s)

#- 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.

Now, use gcu or gcip to destroy the dash
gcc works

I noticed this while working with yaml files. The position of the dash seems important. In the last line it doesn't do anything

@kurkale6ka
Copy link
Author

Also, with # - it works. Only fails when they are stuck together (#-)

chrisbra added a commit to chrisbra/vim-commentary-1 that referenced this issue Aug 24, 2017
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 tpope#92
chrisbra added a commit to chrisbra/vim-commentary-1 that referenced this issue Oct 18, 2017
If the text is not consistently commented like this:

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
chrisbra added a commit to chrisbra/vim-commentary-1 that referenced this issue Oct 18, 2017
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

This appears to have been fixed by by89f43af18692d22ed999c3097e449f12fdd8b299.

@tpope tpope closed this as completed 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

No branches or pull requests

2 participants