-
Notifications
You must be signed in to change notification settings - Fork 7.6k
If first line in selection is a line comment, Block Comment does nothing #2118
Comments
I think Block Comment may be trying to be overly clever with line comments. For example, if I select a single line-comment, Block Comment actually uncomments it (it does the same thing as Line Uncomment). If I select two consecutive line comments (and nothing else), then Block Comment no-ops. Or the above case: if I select a bunch of uncommented code that includes line-comments, depending on what the first line is Block Comment will either no-op or wrap in a block comment. It seems like the command might be more predictable, and the implementation simpler, if Block Comment just totally ignores the presence of line comments... |
I knew i was missing some cases on the implementation. I'll try to fix those. I do like the idea of having block-comment to uncomment line comments, is actually how Sublime Text 2 does it. Even removing this, it might still not make it that easier, since the Tokenizer only gives information about a comment and not if it is a line or a block-comment, so then we need to know in a line comment if we are inside a block comment or nor in some way, which is how it does it now. What I think is missing is having the line-comment uncomment a block-comment, so that it works similar to block-comment. |
Reviewed, assigned to @peterflynn to work with Tom. |
Nominating for Sprint 18 |
I guess this never got marked as Fix in Progress. Oh, well, FBNC back to @peterflynn . |
I can confirm this one is fixed now. Note that there are still a few inconsistencies remaining in block comment behavior, tracked in #2337. |
Result: nothing happens
Expected: code is wrapped in a block comment
This also happens if the first line(s) are whitespace -- as long as the first non-whitespace line is a line comment, Block Comment won't do anything.
The text was updated successfully, but these errors were encountered: