[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH 1/2] rcfile: allow a syntax name to be unquoted
From: |
Brand Huntsman |
Subject: |
Re: [Nano-devel] [PATCH 1/2] rcfile: allow a syntax name to be unquoted |
Date: |
Thu, 8 Feb 2018 04:50:36 -0700 |
On Thu, 8 Feb 2018 12:23:18 +0100
Benno Schulenberg <address@hidden> wrote:
> Op 08-02-18 om 00:23 schreef Brand Huntsman:
> > the code doesn't restrict syntax names to only alpha characters (and
> > shouldn't), so why does nanorc only highlight alpha characters?
>
> Ah. Hadn't thought of that. Would alnum plus the slash be enough?
It should support anything nano supports, and nano supports everything except
for whitespace.
> > I was using this before to highlight the quoted syntax names: color
> > cyan "^[[:space:]]*syntax[[:space:]]+\"[^ ]+\""
> >
> > And now use this (with your patch): color cyan
> > "^[[:space:]]*syntax[[:space:]]+(\"[^ ]+\"|[^ ]+)"
>
> Aren't the backslashes superfluous? And shouldn't the latter part
> include the double quote in its exclusion for the preceding part to
> be effective?
>
> [^" ]+
Nano doesn't care if it contains a double-quote.
syntax nano"rc "..."
nano -Y 'nano"rc' nanorc.nanorc
As for the escaped quotes, nano should be fixed to require them. Try a regex
that has a space after a quote.
color red "[^" ]"