On Wed, Aug 09, 2006 at 07:36:26PM +0200, [EMAIL PROTECTED] wrote:
> At home my matchit works, but not at work.
>
> My debugging is so far:
> :sourcing matchit by hand
> :set verbose=15
> - placing cursor on an If of an If/End If block
> - pressing %
> -> calls of Function 4_Match_wrapper are shown by verbose,
> the last lines are:
> line 23: return 0
> function <SNR>4_Match_wrapper..<SNR>4_CleanUp returning #0
> continuing in function <SNR>4_Match_wrapper
> function <SNR>4_Match_wrapper returning #0
>
> -> If there is a bracket pair () at the same line, the cursor
> goes to the closing bracket, but not to the corresponding item.
> If there are no brackets, vim does *nothing*.
>
> Anyone has a further clue for debugging?
>
> Thank You
>
> Joachim
>
>
> (vim 6.2 , matchit 1.11)
For the sake of lurkers: matchit.vim is included in the standard
distribution under $VIMRUNTIME/macros/ . It gives improved matching
with the % key.
After you :source matchit.vim, the % key is mapped to call a
function, and this part seems to be working properly. That function
then looks for the variable b:match_words to decide what to do. If you
look at the 23'rd line of the function (as the debug output suggests)
you will see
elseif !exists("b:match_words") || b:match_words == ""
silent! normal! %
return s:CleanUp(restore_options, a:mode, startline, startcol)
end
so it seems that b:match_words has not been defined. To confirm, try
:echo b:match_words
and look for an error message.
Usually b:match_words is defined by the ftplugin files. Do you
have a line like
filetype plugin indent on
in your vimrc file? Or use
:scriptnames
and see whether you are loading an ftplugin file for the current buffer.
It is also possible that, since you are using a recent version of
matchit.vim and an old version of vim, that neither the script nor the
ftplugin includes support for your language.
HTH --Benji Fisher