[TxMt] Re: <script> tag intepreted as source.js.embedded.html

Graham Heath graham.p.heath at gmail.com
Sat Nov 29 19:15:10 UTC 2014


I usually place the cursor or start of the selection on the open of the script tag and double press the comment hot key to do this. The first comments the script tag as though it were js, which removes the js scope, the second acting in the HTML scope uses the <!-- --> commenting. I manually remove the slashes when I'm uncommenting.

In testing it seems like placing the character at the beginning of the line works as well.

Allan spoke to this issue before in a thread about fold guides. And it sounds like they may be working on it. 

He said quote:

"The issue here is that the entire line with the <script> tag is scoped as source.js so it gets the folding patterns setup for JavaScript (not HTML).

The easy fix is to move the matching of <script> to the folding settings in the JavaScript bundle, the more involved fix would be to scope the <script> (and <style>) tags “properly” — I think this is something Michael have been meaning to do for some time, but it’s a little tricky because the current scoping is actually to make themes look good (when they change background color of the embedded code and want to include the tags)."

I hope this was helpful.

Sent from my iPhone

> On Nov 29, 2014, at 8:22 AM, Quinn Comendant <quinn at strangecode.com> wrote:
> 
> In TM2, when a <script …> tag is prepended by any whitespace, the scope changes from `meta.tag.any.html` to `source.js.embedded.html`. This causes problems with the Comment Line command, as with the latter scope it prepends JS comments instead of HTML comments.
> 
> This problem exists when either HTML or PHP language is set for the document.
> 
> I don't think I've modified these language bundles. Any ideas for a fix?
> 
> Quinn
> 
> 
> <Screen Shot 2014-11-29 at 19.59.58.png>
> <Screen Shot 2014-11-29 at 20.00.21.png>
> 
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate


More information about the textmate mailing list