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

Toggle Block Comment doesn't work if the open/close delimiters are the same #3057

Closed
peterflynn opened this issue Mar 7, 2013 · 6 comments
Closed

Comments

@peterflynn
Copy link
Member

  1. Add this line to the CoffeeScript section of languages.json: "blockComment": ["###", "###"],
  2. Open a .coffee file with these contents:
foo = 42
bar = true
baz = "hello"
number = -42 if bar
square = (x) -> x * x
  1. Select the middle 3 lines and Toggle Block Comment
  2. Immediately Toggle Block Comment again
  3. Undo back to clean state
  4. Repeat step 3
  5. Select all the lines, including the ### lines, then Toggle Block Comment again
  6. Undo back to a clean state
  7. Select just one line (without including newlines) and Toggle Block Comment
  8. Either (a) immediately toggle again, or (b) re-select the whole line to include delimiters and then toggle

Result:
4 - closing delimiter isn't removed
7 - comment is wrapped in a second pair of ### lines
10 - one "#" is removed from the opening ###, but nothing else changes

@peterflynn
Copy link
Member Author

@TomMalbran interested in digging back into the block comment code at all? :-)

@TomMalbran
Copy link
Contributor

Sure. I'll take a look later today.

@TomMalbran
Copy link
Contributor

By the way, you need to add lineComment: "#" too, to get the same results as 10.

@njx
Copy link
Contributor

njx commented Mar 11, 2013

Reviewed. Marking medium priority. Thanks for fixing this Tom.

@njx
Copy link
Contributor

njx commented May 19, 2014

FBNC to @peterflynn - this finally landed.

@TomMalbran
Copy link
Contributor

I am going to close this, since it does work.

This issue was closed.
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

4 participants
@njx @peterflynn @TomMalbran and others