Home Download Buy Blog Forum Support

SublimeTagmatcher

SublimeTagmatcher

Postby pyparadigm on Tue Aug 23, 2011 4:50 am

If you click inside the begin tag, it will highlight the end tag, and vice versa.

GitHub
Project: https://github.com/pyparadigm/SublimeTagmatcher
Direct Download: https://github.com/pyparadigm/SublimeTa ... all/master

Screenshot
Image
pyparadigm
 
Posts: 23
Joined: Thu Aug 04, 2011 8:15 am

Re: SublimeTagmatcher

Postby iamntz on Tue Aug 23, 2011 5:41 am

Looks pretty neat!
Can you move the files in the root folder so the package manager can install it with no issue? Right now the package manager (also if i clone the git repo) it creates this structure: User/SublimeTagmatcher/SublimeTagmatcher and it should be only User/SublimeTagmatcher.

Also, can you do the very same thing for brackets match? I mean instead of detecting tags to detect { } ( ) on js/php files (and other) ?

Thanks!
iamntz
 
Posts: 819
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: SublimeTagmatcher

Postby FalconNL on Tue Aug 23, 2011 5:48 am

Very nice. Still needs a bit of tuning, though. Using the snippet

Code: Select all
<html>
<head>
    <title>Sumoview</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="stylesheet" type="text/css" href="css/site.css">
</head>
</html>

there are couple of incorrect matches:
  • <html> matches </head>
  • Both <link> tags match </head>
  • </head> matches the second <link> tag
  • </html> matches the second <link> tag
Once these bugs are fixed though, this will be make working with html/xml files a lot nicer.
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: SublimeTagmatcher

Postby pyparadigm on Tue Aug 23, 2011 6:07 am

It does that because it is malformed XML/XHTML, it should be /> on self closing tags.

Code: Select all
<html>
<head>
    <title>Sumoview</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link rel="stylesheet" type="text/css" href="css/site.css" />
</head>
</html>
pyparadigm
 
Posts: 23
Joined: Thu Aug 04, 2011 8:15 am

Re: SublimeTagmatcher

Postby pyparadigm on Tue Aug 23, 2011 6:23 am

iamntz wrote:Looks pretty neat!
Can you move the files in the root folder so the package manager can install it with no issue? Right now the package manager (also if i clone the git repo) it creates this structure: User/SublimeTagmatcher/SublimeTagmatcher and it should be only User/SublimeTagmatcher.

Also, can you do the very same thing for brackets match? I mean instead of detecting tags to detect { } ( ) on js/php files (and other) ?

Thanks!

I changed the folder structure, but I did not understand the other part?
pyparadigm
 
Posts: 23
Joined: Thu Aug 04, 2011 8:15 am

Re: SublimeTagmatcher

Postby paulstraw on Tue Aug 23, 2011 6:24 am

pyparadigm wrote:It does that because it is malformed XML/XHTML, it should be /> on self closing tags.

Code: Select all
<html>
<head>
    <title>Sumoview</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link rel="stylesheet" type="text/css" href="css/site.css" />
</head>
</html>


That's only true for XML/XHTML, not standard HTML: http://wiki.whatwg.org/wiki/FAQ#Should_I_close_empty_elements_with_.2F.3E_or_.3E.3F
paulstraw
 
Posts: 11
Joined: Sat Apr 09, 2011 11:27 pm

Re: SublimeTagmatcher

Postby iamntz on Tue Aug 23, 2011 6:35 am

pyparadigm wrote:I changed the folder structure, but I did not understand the other part?

A picture is like a tousand words. Therefore: http://screencast.com/t/cuuJovy8 :)

The editor adds some basic highlight for bracket matching but sometimes the underline is somehow invisible. I'm thinking that outline will make them more... visible.

And Jon doesn't want to add this feature :D (even if there are almost 200 votes for this)
iamntz
 
Posts: 819
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: SublimeTagmatcher

Postby oriceon on Tue Aug 23, 2011 6:50 am

Nice plugin! Would be nice if a brackets costumization could be done with some kind of plugin like this one.
oriceon
 
Posts: 56
Joined: Tue Jun 14, 2011 6:06 am

Re: SublimeTagmatcher

Postby skaet on Tue Aug 23, 2011 7:34 am

This is great, thank you!

It has already been mentioned that self-closing tags are matching the next available </ when they don't end with a trailing />. I will continue using this as it is very useful, but some improvements will be appreciated :)

The most common tags this applies to are: link, meta, img, input, br, hr.
Less common: frame, area, col, base, basefront, param.

Perhaps the best way to ensure accuracy is to parse the file for the full tag name instead of the first unclosed </ (obviously including exceptions for the above tags). This will also solve inadvertently matching those pesky overlapping tags like "<a><b></a></b>"
skaet
 
Posts: 93
Joined: Thu Sep 16, 2010 3:37 pm

Re: SublimeTagmatcher

Postby pyparadigm on Tue Aug 23, 2011 9:06 am

Thanks for the suggestions, I added support for common HTML elements like link, meta, etc. without self closing and fixed some other issues.
pyparadigm
 
Posts: 23
Joined: Thu Aug 04, 2011 8:15 am

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 3 guests

cron