gregsexton / MatchTag

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

Highlight doesn't work if second tag is not visible on the screen #4

Open jandudulski opened 12 years ago

jandudulski commented 12 years ago

Highlight doesn't work if second tag is not visible on the screen. Even if you scroll/resize to catch both tags on screen, you have to move cursor from tag and on again to get the match.

gregsexton commented 12 years ago

This is by design I'm afraid. The reason for this is so that the search doesn't take too long. The matching logic is executed every time the cursor is moved so speed is important. This is also the way MatchParen works.

You are not the first person to request this but I'm still sat on the fence as to whether to implement it. For now you can change line 65 from

let stopline = a:forwards ? line('w$') : line('w0')

to

let stopline = 0