[Top][All Lists]

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

Re: [Nano-devel] Perl Syntax Highlighting

From: David Benbennick
Subject: Re: [Nano-devel] Perl Syntax Highlighting
Date: Fri, 28 Feb 2003 20:37:43 -0500
User-agent: Mutt/

On Fri, Feb 28, 2003 at 11:22:53PM +0000, Richard Smith wrote:
> Hopefully this will act as a starter for somebody willing to clean it
> up.

Hi Richard,

You might find coloring is faster with the attached entry.  I took your
function names and combined them into one red entry.  (Did the same with
magenta keywords.)  When you have multiple expressions (each one in
quotes) Nano has to loop through each, coloring them individually.  If you
combine them, Nano only has to test that one expression.  I.e., instead of

color red "accept" "alarm"

it should be more efficient to say

color red "accept|alarm"

(I also bunged around with the red function names, to make that line short
enough.  Lines in .nanorc have to be only 1023 characters long.)

Finally, I put \< and \> around the function and keyword names.  I don't
know Perl, but I think that's what you want.  \< matches the beginning of
a word, and \> the end.

Attachment: perl.syntax
Description: Text document

Attachment: pgpYPDV9G3Eac.pgp
Description: PGP signature

reply via email to

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