The matchparen feature stops highlighting the matching "paren"
character when the number of buffer lines between the two parens
exceeds the screen height, even when some of those lines are folded
so that both parens are visible on the screen simultaneously. This
makes it difficult to find matching braces in C code, for example,
when viewing long functions in which inner blocks have been folded.
This behavior seems to be in conflict with ":help matchparen" which
says in part:
The search is limited to avoid a delay when moving the cursor.
The limits are:
- What is visible in the window.
- 100 lines above or below the cursor to avoid a long delay when
there are closed folds.
- 'synmaxcol' times 2 bytes before or after the cursor to avoid a
delay in a long line with syntax highlighting.
To demonstrate this, using vim 7.1.236 and matchit.vim version 2008
Jan 06 and running on Red Hat Enterprise Linux WS release 4, do the
following.
- Open an xterm window, 80x24.
- Execute
vim -N -u NONE -c 'runtime plugin/matchparen.vim'
- Insert into the buffer:
- A blank line on line 1
- An opening brace ({) on line 2
- Blank lines 3 through 24
- A closing brace (}) on line 25
- A blank line on line 26
I inserted just enough blank lines between the two braces so that
both braces were not visible on-screen at the same time. I inserted
blank lines and the start and end of the buffer to eliminate any
problems with either brace being on the first or last line.
- Move the cursor to somewhere in the middle of the buffer, line
12 for example.
- Type
Vjzf
to fold two lines.
- Move the cursor to either brace and note that the matching
brace is not highlighted.
As an enhancement request after this is fixed, it would be nice if
that limit of 100 lines above or below the cursor could be
user-settable for when looking at really long blocks of code
containing folds.
Regards,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---