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

Add ability to create a line of comment characters #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ElPiloto
Copy link

Add functionality to insert a line from comment characters and to toggle
back to a blank line.

This requires the following modifications:

Simple function to insert the line of comment characters.

Modify UncommentNormalLine() to detect a line of pure comment characters
and remove all of them (i.e. toggle).

Create default mapping (c_)

Add option NERDNumCommentCharsHR to specify the width of the line made
from comment characters.

Update help documentation for new functionality, default key mapping,
and new option.

Add functionality to insert a line from comment characters and to toggle
back to a blank line.

This requires the following modifications:

Simple function to insert the line of comment characters.

Modify UncommentNormalLine() to detect a line of pure comment characters
and remove all of them (i.e. toggle).

Create default mapping (<Leader>c_)

Add option NERDNumCommentCharsHR to specify the width of the line made
from comment characters.

Update help documentation for new functionality, default key mapping,
and new option.
alerque added a commit to alerque/nerdcommenter that referenced this pull request May 24, 2016
Add ability to create a line of comment characters
@alerque
Copy link
Member

alerque commented May 24, 2016

Thanks for taking the time to contribute @ElPiloto. I've recently been added as a maintainer to this project and am going through the backlog of contributions. This is a neat idea but it's a bit rough around the edges and I don't think I can merge it at this time.

I played around with it a little bit including fixing the merge conflicts then cleaning up the variable names. You can see the result in my horizontal-rules branch. If you'd like to keep working on this I'd invite you to start from that code, but there are still some things missing:

  • Non homogeneous delimiters are messy. This works great for single character delimiters, but when the delimiter is something like <%# (ruby) the result is a mess.
  • It doesn't properly uncomment lines.
  • It isn't taking into account that there might be some characters on the line already and blinding throws 72 new characters into the buffer even if part of the line was drawn.

I'd like to see something more like the sexy comment format that figures out and intermediary character and fills with that rather than just repetition of the opening delimiter. Would it be possible for you to work on these things.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants