Home Download Buy Blog Forum Support

How does comment toggling work?

How does comment toggling work?

Postby charlesroper on Tue Aug 02, 2011 10:39 pm

I don't understand how the Comments.tmPreferences file works. I'm working on the SCSS package and have the following:

https://gist.github.com/1121399

This works fine: hitting ctrl-/ comments a line by adding //[space] to the beginning. If I select a region and do the same, each line is commented. Hitting Ctrl-Shift-/ does exactly the same. So far, so good.

What I'd like to do is, when hitting Ctrl-Shift-/, the alternate type of comment would be used; i.e., /* some stuff */. This is a block style comment, so it only needs to add the comment tokens at the start and end, just like CSS. So I looked at the CSS comments.tmPreferences and use that to create this one for SCSS:

https://gist.github.com/1121410

Now when I select a region and hit Ctrl-Shift-/, the correct tokens get inserted at the start and end. However, a subsequent hit of Ctrl-Shift-/ doesn't toggle the region comment off again but instead adds another set of tokens.

How can I get it to toggle off like the CSS syntax does?
charlesroper
 
Posts: 107
Joined: Thu Feb 18, 2010 7:30 am

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 20 guests