[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] syntax: sh: color options distinctively, and co
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] [PATCH] syntax: sh: color options distinctively, and color also long options |
Date: |
Thu, 29 Mar 2018 09:55:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
Op 28-03-18 om 20:19 schreef Brand Huntsman:
> On Wed, 28 Mar 2018 14:31:40 +0200
> Benno Schulenberg <address@hidden> wrote:
>
>> +# Short and long options.
>> +color brightmagenta "-[A-Za-z]\>" "--[A-Za-z-]+\>"
>
> Won't that color the end of filenames and functions that contain a hyphen?
Yes, but only if the name ends in a hyphen plus a single letter,
or the name contains a double hyphen. The first is somewhat
unlikely, the latter quite unlikely.
The syntax already colored -[Ldefgruwx] and -[snz]. I don't see
why it should color only those options.
Thanks for commenting, because the hyphen was missing from the
regex that covers function names:
# Function declarations.
-icolor brightgreen "^[0-9A-Z_]+\(\)"
+color brightgreen "^[A-Za-z0-9_-]+\(\)"
Benno
signature.asc
Description: OpenPGP digital signature