[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] regarding color syntax
From: |
David Benbennick |
Subject: |
Re: [Nano-devel] regarding color syntax |
Date: |
Wed, 18 Sep 2002 02:00:34 -0400 |
User-agent: |
Mutt/1.2.5.1i |
The example
color brightyellow "\"(\\.|[^\\"])*\""
can be replaced with
color brightyellow ""(\\.|[^\"])*""
to get the same effect. ** Note that color strings in the rc-file do not
use backslash-escaping! Regexec interprets the \-escaped characters
\^ \. \[ \$ \( \) \| \* \+ \? \{ and \\
but Nano doesn't expect quotes to be escaped. Also, no \-escapes at all
are interpreted within [ bracket expressions ].
On Tue, Sep 17, 2002 at 07:20:13PM -0500, Jeff DeFouw wrote:
> With quote36b.patch the entire line highlights here, but 'not this'
> probably shouldn't be highlighted.
The regexp applied to the line
"This string contains two \"quote characters\" in it" not this "but this"
matches the substrings
"This string contains two \"quote characters\" in it"
"quote characters\" in it"
" in it"
" not this "
"but this"
Put these substrings together, and you get the whole line! In
quote36b.patch I made edit_add() be careful to paint everything that
matches. That seemed like the most logical behavior, but apparently it is
not as convenient. In Nano CVS, the paint routine doesn't allow
overlapping match regions, so only sees the first and last matches.
Here's a tiny patch that fixes the problem. (It applies after quote36b.)
string.patch
Description: Text document
pgp0N_Nh3YTo7.pgp
Description: PGP signature