nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] syntax highlight tweak for bash scripts


From: Benno Schulenberg
Subject: [Nano-devel] syntax highlight tweak for bash scripts
Date: Wed, 31 May 2006 23:34:25 +0200
User-agent: KMail/1.9.1

Hi,

The highlighting example for Bourne shell scripts does not colour 
all special variables, such as $? and $@, correctly.  Attached 
patch fixes this.  It makes a small change to the comment colouring 
too, to prevent the $# variable from being recoloured.

Personally I split up the string colouring into 
  color brightyellow ""(\\.|[^"])*""
before, and
  color brightyellow "'(\\.|[^'])*'"
after the brightred variable colouring, so that it shows which 
variables get evaluated and which not.  See the second patch.  This 
of course causes strings that contain a "#" to be miscoloured, but 
currently strings inside comments are miscoloured, so that's about 
even, I think.


Something else entirely.  In prompt.c and nano.c there is this 
construction that I don't understand:

            if (*meta_key == TRUE)
                *meta_key = FALSE;

Why check for truth first?

Benno

Attachment: nano--bash-hilite.patch
Description: Text Data

Attachment: nano--bash-hilite-2.patch
Description: Text Data


reply via email to

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