Bill McCarthy wrote:
> On Fri 24-Aug-07 12:03pm -0600, Tony Mechelynck wrote:
>
>
>> 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.
>
> Interesting - it does not work here with the latest
> matchit.vim (from macros) copied to my \vim\vimfiles\plugin\
> and :se ft=cpp
>
> The first '{' is highlighted when I'm on '}' but '%' jumps
> to the '{' in the C++ comment.
>
What is b:match_words set to in that buffer?
You might be interested in the following snippet from my vimrc:
if has('autocmd')
augroup vimrclocal
au FileType c,cpp,css,javascript
\ let b:match_words = &matchpairs
augroup END
endif
Best regards,
Tony.
--
MICHAEL PALIN PLAYED: 1ST SOLDIER WITH A KEEN INTEREST IN BIRDS, DENNIS, MR
DUCK (A VILLAGE CARPENTER WHO IS ALMOST KEENER THAN
ANYONE ELSE TO BURN WITCHES), THREE-HEADED KNIGHT, SIR
GALAHAD, KING OF SWAMP CASTLE, BROTHER MAYNARD'S ROOMATE
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---