Handlebars icon indicating copy to clipboard operation
Handlebars copied to clipboard

Using command + / on an HTML comment results in it being surrounded by a Handlebars comment

Open lazd opened this issue 12 years ago • 4 comments

Steps:

  1. Create a template, template.hbs
  2. Open it in Sublime
  3. Add a comment with HTML in it:
<!-- <a href="http://moo.cow.com/">Link</a> -->
  1. Select the comment (from < to >) and press command + /

Result:

Selection is wrapped in Handlebars comment:

{{! <!-- <a href="http://moo.cow.com/">Link</a> --> }}

Expected:

Selection is uncommented:

<a href="http://moo.cow.com/">Link</a>

lazd avatar May 12 '13 22:05 lazd

This is a tricky one, I'm not sure what would be a good way to handle both Handlebars and HTML comments.

Since we're in Handlebars context I'd say Handlebars comments should take precedence and use the / + / shortcut, but a separate one for HTML comments should probably be available. Maybe + / + /?

daaain avatar May 14 '13 15:05 daaain

Unfortunately + + / is a global shortcut to opening the Help menu search box, so best not override that =)

henrahmagix avatar May 29 '13 14:05 henrahmagix

Ouch, haven't actually tried pressing the combination before suggesting! :)

+ + / seems to be available though? Wonder if it's free on Windows and Linux...

daaain avatar May 29 '13 14:05 daaain

I too vote for prioritizing handlebars comments!

timohofmeijer avatar Jul 05 '13 14:07 timohofmeijer