vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] vile, perl, TeX, bracket pairing


From: Thomas Dickey
Subject: Re: [vile] vile, perl, TeX, bracket pairing
Date: Mon, 9 Feb 2015 19:39:06 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Feb 09, 2015 at 07:03:24PM -0500, address@hidden wrote:
> So I've found an issue, and I'm sure the answer is "Too bad" but I
> figured I'd ask anyway.
> 
> I have a Perl script whose purpose is to generate a TeX file.
> Both Perl and TeX use curly-brackets { } for grouping things.
> 
> So I might have a construct like this:
> 
> if (something)
> {
>   print '{\tt This is typewriter font';
> }
> else
> {
>   print '{\bf This is boldface font';
> }
> print ' and this is more text in that font.}',"\n';
> 
> The two different uses for brackets will interfere with each other
> when I try to use the % command to match my brackets into pairs.
> 
> I don't suppose there's anything to be done, where vile might (for example)
> recognize the difference between a bracket inside a pair of quotation
> marks and a bracket that is not inside a pair of quotation marks.
> 
> Like I said, I think I'm out of luck, but I thought I'd ask.

you're correct - vile doesn't do this.  I recall it being discussed before.
I have thought about it - here's a note from my (10,000 line) to-do list:

        20060220 should add feature for colored-fences (to make matches take
        color into account).  Also (like lynx's tagsoup) add a mode that
        controls whether a fence (group) has to be properly nested, e.g.,
        nested-fences.

That is, use the syntax highlighting as a guide.  It's "doable", but likely
to be slow(er) since there's no direct way to get the color for a given
cell (because vile uses regions...).

fwiw, vim (checked against a script I'm working on) handles curly braces
inconsistently versus quotes and regular expressions.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]