Home Download Buy Blog Forum Support

How does tag matching work?

How does tag matching work?

Postby ChadW on Mon Sep 17, 2012 8:40 pm

How does the tag matching in XML and HTML work?

I've looked in the .tmLanguage files (and tried twiddling them a bit), but can't locate what indicates a matching tag and how to handle it.
I've also searched the forums for the relevant feature, and noted some posts from years ago noting the lack of such feature, but no announcement for when it was added (as I figured that might have some details).
It seems that the functionality is built into the highlighting engine rather than through a plugin, though I'm not sure.

The purpose of my explorations is to build something similar for a language that has a somewhat similar syntactic feature, with blocks delimited like so:
Code: Select all
(outer
    (inner
        stuff
    )inner
)outer

And I'd like to implement a similar matching feature. I'd also like to be able to use the "close_tag" command to close the blocks, but it seems that functionality is baked into Sublime. If I get lots of energy I might have to figure out how to duplicate such a feature in a package, but first I'll take highlight matching.
ChadW
 
Posts: 21
Joined: Fri Sep 23, 2011 7:45 pm

Re: How does tag matching work?

Postby nick. on Tue Sep 18, 2012 12:16 am

Have you tried Bracket Highlighter?
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: How does tag matching work?

Postby ChadW on Tue Sep 18, 2012 1:03 am

No, I hadn't seen that. Looks like I should be able to bend that to my will, especially since I'd also like to fill in or change the closing tag based on the opening one.

I'm still interested in how the base system works, but the Bracket Highlighter should get me going for sure. Thanks!
ChadW
 
Posts: 21
Joined: Fri Sep 23, 2011 7:45 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 13 guests