On Wed, Sep 06, 2006 at 01:20:13AM +0200, A.J.Mechelynck wrote: > > It's supposed to treat ? and : on the one hand, and = and ; on the other > hand, as "paired brackets". However, the matchparen plugin uses a rather > elementary algorithm to split 'matchpairs' into individual items: any > colons and commas are regarded as delimiters, and then odd "parts" are > treated as "left brackets", even ones as "right brackets".
Good catch. I think the line you are referring to is let plist = split(&matchpairs, ':\|,') in $VIMRUNTIME/plugin/matchparen.vim . > I see the following possible cures, use only one of them: > (a) disable matchparen matching > > :set loaded_matchparen = 1 > > (b) remove the questionable pair "?::" from the 'matchpairs' options > > (c) patch plugin/matchparen.vim to refine the splitting algorithm, so > that a colon should be treated as either a separator or a "bracket" > depending on position within the option. Now that the problem has been pointed out, I think the patch should be made in the official distribution. How about (simple but oh, so clever) let plist = split(&matchpairs, '.\zs.') which removes every second character? Will that have trouble with multibyte characters? Are these even allowed in 'matchpairs'? HTH --Benji Fisher P.S. cc'ed to vim-dev for further discussion