Loading ...
Sorry, an error occurred while loading the content.

41456Re: Bugs in % command

Expand Messages
  • Walter Briscoe
    Jul 3, 2003
    • 0 Attachment
      In message <005c01c340ec$17476400$6501a8c0@tata> of Thu, 3 Jul 2003
      00:48:43 in , Jiri Jezdinsky <jezdinsky@...> writes
      >I discovered interesting bug of parenthesis/braces pair match command %.
      >
      >Copy and paste next six lines into vim:
      > sub Licence {
      > $sth = $dbR->Query("
      > SELECT * FROM lll WHERE LICENCE='$FILL{'LICENCE'}'
      > ") or die $Mysql::db_errstr;
      > # ... not important
      > }
      >
      >then navigate to last } and press %. Cursor will not move to the first
      >line,
      >as expected, but to the third line, after $FILL.
      >I encountered this bug in version 6.2 (Windows) and 6.1 (Linux)
      I had a look at this and hit the problem.
      It does not happen with vim -u NONE where matchpairs=(:),{:},[:] or
      where matchpairs=(:),{:},[:],<:>. Can you produce a minimal failure?

      >
      >
      >Second bug - vim treats {[()]} in comments like active, while searching
      >for
      >pair match. It makes this much less reliable, because I use it to find
      >out
      >if I have correct number of {} in functions, if-else, etc.
      >
      >Is there any solution how to ignore commented {[()]}, especially in
      >Perl?
      This is traditional vi behaviour. I do not expect % to be syntax-aware.
      Don't use unmatched brackets!
      --
      Walter Briscoe
    • Show all 2 messages in this topic