[TxMt] [ANN] Select Balanced HTML Tag!!!3!

Hans-Jörg Bibiko bibiko at eva.mpg.de
Thu Nov 29 10:26:47 UTC 2007


Hi,

here comes two macros:

1) Select Balanced (HT|X)ML Tags
Caused of the speed of the parser I changed the behaviour for that  
case if the caret is inside of a start tag. I pre-parse the entire  
text for setting the caret. Now it will select this tag.

example:
<p>fo|o</p>
<p>foo</|p>
<|p>foo</p>

now all will select

"<p>foo</p>"

I believe this is more logically. It only takes some ticks more.

2) Select Content of Balanced (HT|X)ML Tags
This macro will only select the content between the found tags.
Here the behaviour differs from macro 1) if the caret is inside of a  
start tag. It will select that tag pair which is one level up.  
Otherwise one wouldn't be able to redo that macro if it already found  
something.

Both macros I also tested on very large documents and the speed is OK.

Please these macros if I missed something.

Cheers,

--Hans

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Select Content of Balanced (HT|X)ML Tags.tmMacro
Type: application/octet-stream
Size: 5342 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20071129/de218c44/attachment.tmMacro>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Select Balanced (HT|X)ML Tags.tmMacro
Type: application/octet-stream
Size: 6635 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20071129/de218c44/attachment-0001.tmMacro>


More information about the textmate mailing list