[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] brace matching
From: |
Thomas Dickey |
Subject: |
Re: [vile] brace matching |
Date: |
Mon, 4 Apr 2016 20:36:21 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sat, Apr 02, 2016 at 04:37:09PM -0400, Thomas Dickey wrote:
> On Sat, Apr 02, 2016 at 01:23:20PM -0400, Wayne Cuddy wrote:
> > On Sat, Apr 02, 2016 at 10:06:50AM -0700, Marc Simpson wrote:
> > > On Sat, Apr 2, 2016 at 9:29 AM, Wayne Cuddy <address@hidden> wrote:
> > > >
> > > > Is it known that using the goto-matching-fence function on the { on line
> > > > 1 below will move the cursor to the '}' on line 2 and not the one on
> > > > line 4?
> > >
> > > FWIW, this is traditional vi behaviour (unsurprisingly, given the lack
> > > of contextual information).
> >
> > Huh, indeed you are correct. Hard to believe I never ran across this
> > before. Nested brace blocks are handled correctly and I mistakenly
> > thought the processing of fence-pairs was handled "specially" in
> > cppmode to account for things like this. I figure for 99% of use cases
> > the traditional vi behavior is useless.
> >
> > When vim is in 'nocompatible mode' it does what's expected. I'm
> > assuming vile doesn't have an option to enable this behavior.
>
> That's correct. I have a note from 2001 regarding vim, and seem to
> recall some discussion about making vile do this, suggesting that it
> would be possible to use the syntax coloring information to limit the
> choices of fence matching. (I'd have to dig into vim's code, but my
> recollection was that its behavior was hardcoded, assuming C language
> syntax -- Perl can be a bit harder).
For what it's worth, the problem of matching in vile is more complicated
than (what I see) vim doing. If I tell vim to match a curly brace in
a Perl script, it is only doing the curly brace. vile tries (and often
succeeds) in matching if-then-else pattern. Still, making vile ignore
matches in areas that are colored differently might make it better...
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature