Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Line Comment should delegate to Block Comment in block-only languages like CSS #2119

Closed
peterflynn opened this issue Nov 15, 2012 · 3 comments

Comments

@peterflynn
Copy link
Member

  1. Open a CSS file
  2. Press Ctrl+/

Result: nothing happens

Expected: fall back to block comments when line comments are unavailable

There's a twist, though: in some editors (like Sublime), the block comment behavior is subtly different when invoked as a fallback like this. When there's no selection, the entire line is wrapped in a block comment (the normal behavior, and what you get if you invoke block comment explicitly, is to insert an empty block comment at the cursor position).

@TomMalbran
Copy link
Contributor

This is what i was planning to implement next, but wasn't sure if it should just make a block comment over the selection, or over all the lines in the selection. Maybe this second approach might work better on HTML, where commenting a block over several lines that don't include the complete lines is not usual.

In any case, it should be easy enough, by adding an additional parameter to block-comment with the positions for the prefix and suffix in the case of a block-comment.

@pthiess
Copy link
Contributor

pthiess commented Nov 15, 2012

This is a very nice ECR, I assign @peterflynn just because we can't assign to Tom directly.

@peterflynn
Copy link
Member Author

This is solid! I wrote some unit tests to cover this too, which I'll put up a pull request for as soon as #2342 is ironed out.

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

No branches or pull requests

3 participants