gregsexton / MatchTag

Vim's MatchParen for HTML tags
http://www.vim.org/scripts/script.php?script_id=3818
310 stars 31 forks source link

ENH: Support tags that span multiple lines. #18

Closed inkarkat closed 11 years ago

inkarkat commented 11 years ago

Some code styles spread tags that have many attributes over multiple lines, e.g.

<foo bar="1"
     baz="2">

This patch extends the highlighting to those tags. In s:GetCurrentCursorTag(), when the current line does not contain a full tag, as a fallback the start of a tag is accepted. (It does not verify that the tag is actually properly closed in following lines.) In s:SearchForMatchingTag(), the patterns are modified to also match newlines (while ensuring that when searching for the start tag, the current end tag is not accidentally matched). (The patterns already include the fix for subset tag names from bc576b5ead1f183f72884108bbb3d2c8763e7993.)

gregsexton commented 11 years ago

Please fix the indentation and then I'll be happy to merge this in. Thanks for your work on this.

inkarkat commented 11 years ago

Ah sorry about that. I've pushed a corrected commit and added a modeline + correction for the few original lines (not from my patches) where the indents were off.

gregsexton commented 11 years ago

Thanks