Edward L. Fox wrote:
> Reporter id: chenkw
> Community: newsmth
>
> Hi developers,
>
>
> Steps to reproduce:
>
> Vim 7.0 has a problem jumping between matching brackets in the following case:
> Foo()
> {
> // {
> }
>
> The % command jumps between the close bracket and the open one in the comment
> rather than at the right beginning of function body.
>
>
> Expect behavior:
>
> The % command should jump between semantically matching brackets, such as the
> pair around the function body in the above case.
>
> Notice the correct matching is hilighted when cursor is on a bracket.
Install the matchit plugin (see ":help matchit-install"). One of the
improvements matchit adds to % matching is that it knows about comments: when
you hit % outside a comment it will not jump inside one, and when you hit %
inside a comment it will not jump outside one.
I just tried your example in 7.1.87 with matchit (and filetype set to cpp) and
% jumped from the first to the third brace and vice-versa, completely ignoring
the comment.
Best regards,
Tony.
--
While your friend holds you affectionately by both your hands you are
safe, for you can watch both of his.
-- Ambrose Bierce, "The Devil's Dictionary"
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---