apm install regex-comments
Oniguruma Comment Highlighting
Adds comment-highlighting for Oniguruma-style regex comments.
(?# Breath of fresh air)
The above snippet would be rendered like this:
Geared toward authors of TextMate-compatible grammars.
Targeting CoffeeScript only
By default, this package affects any language where the
(?#…) sequence is used inside a string.
If you’d like to restrict it to specific languages only, just use your stylesheet:
More basic comments are supported, but only under very specific circumstances:
#token is preceded by a whitespace character
]characters are allowed to appear after the
#. This avoids colouring stuff like
- Your theme’s stylesheet adds comment colour to
While this sounds a little counter-intuitive, remember there’s a high risk of misclassification here.
Furthermore, these comments will stop at any quote character, irrespective of whether it was used to start the containing comment block.
So this wouldn’t match the entire comment:
(?=something-complex) # Yes, "complex" indeed
TIP: Use directional quotes instead. Insert them into a “probable” comment-line with the following snippets:
dq] Double quotes:
sq] Single quotes:
# “That’s a decent compromise, I guess.”