Re: Calling Benji: matchit.vim question
- yahoogroups@... wrote:
>This tells matchit.vim that "declare" and "end" form a matching pair,
> I am trying to configure matchit.vim for use with PL/SQL code. Here is what I
> have so far in my sql.vim ftplugin
> let s:notend = '\%(\<end\s\+\)\@<!'
> let b:match_words=''
> " DECLARE/BEGIN/EXCEPTION/END block
> let b:match_words=b:match_words .
with "begin" and "exception" as significant intermediates. It is a lot like
the matching pair "while" and "endwhile" in vim, with intermediates "continue"
and "break". So "declare...begin...exception...begin...end" is analogous to
>Yes. As far as matchit.vim is concerned, the structure is like this:
> Note that the DECLARE is optional in every PL/SQL block.
> If I have a file like
> The problem is that with the cursor on the first declare, when I do %, I indeed
> go to the first BEGIN, but then my next % goes to the next BEGIN instead of
> going to the END on the last line.
> Am I doing something wrong?
with the final "end" unmatched. Keep hitting %, and you should go from the
second "begin" to "exception", "end", and back to "declare".
If the "declare" is optional, you should probably leave it off entirely.
Each matching group should have a unique starting pattern and a unique closing
pattern. There can be any number of intermediate patterns.
> Benji? Help please?Do not think I am the only one who can answer this! I did not write many
of the matching patterns that go with matchit.vim; I mostly think about the
- --- Benji Fisher <benji.at.e-math.AMS.org@...>
> Each matching group should have a unique starting pattern and a uniqueHm. What about patterns common to 2 groups? If I have a group with
> closing pattern. There can be any number of intermediate patterns.
and another group with
The "middle2" is common to both the groups. This seems to be causing
matchit.vim to get confused as to which group's patterns it is bouncing
Almost seems as if all the patterns in all the groups have to be unique. Is
P.S: This is the same discussion as on the other mail I sent you, but it is
more relevant here.
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
- yahoogroups@... wrote:
>Yes, the patterns all have to be unique. If you hit % starting on
> --- Benji Fisher <benji.at.e-math.AMS.org@...>
> > Each matching group should have a unique starting pattern and a unique
> > closing pattern. There can be any number of intermediate patterns.
> Hm. What about patterns common to 2 groups? If I have a group with
> and another group with
> The "middle2" is common to both the groups. This seems to be causing
> matchit.vim to get confused as to which group's patterns it is bouncing
> Almost seems as if all the patterns in all the groups have to be unique. Is
> this right?
"middle2", how is the script supposed to decide where to go next? I think the
best solution here is to use
I think we do something like that in HTML to handle <ul>:<li>:</ul> (unordered
lists) and <ol>:<li>:</ol> (ordered lists).
HTH --Benji Fisher