nerdcommenter icon indicating copy to clipboard operation
nerdcommenter copied to clipboard

C/C++ files: sexy comment across //-style commented lines

Open bartgol opened this issue 8 years ago • 5 comments

Currently, when I try to use the 'sexy' comment style on a piece of code like this


// My comment
some_code_here;

I end up with the following

/*
*// My comment
*some_code_here
*/

Which is not working, since *// closes the commented section. I was wondering if it's possible to insert a space after each * in the commented secion, so to avoid the formation of */ constructs, which for the compiler mean the end of the commented section.

bartgol avatar May 03 '17 16:05 bartgol

That's probably a good idea. Anybody want to tackle this?

alerque avatar May 04 '17 08:05 alerque

Not sure if this option was there from the beginning, but I found out that using let g:NERDSpaceDelims = 1 solves the issue, so I'm going to close this.

bartgol avatar Mar 23 '18 14:03 bartgol

I see how that option mitigates this problem for your use case, but I think it would be nice if we had a proper fix as well. This probably needs to do some kind of search looking for end-tag conflicts and handle them in the same way that nested comments get re-written as alternative tokens.

I'm going to re-open this issue to keep track of it long term and to signal that we're still looking for a proper solution. That way it stays on the radar of things that could use fixing.

alerque avatar Jun 19 '18 10:06 alerque

@alerque Maybe it makes sense to create a new label to indicate, that you would accept PRs. Something like „PR wanted” or so.

Ryuno-Ki avatar Jun 30 '18 23:06 Ryuno-Ki

@Ryuno-Ki Please don't repeat the same comment more than one place. See here for my response.

alerque avatar Jul 02 '18 08:07 alerque