From 1dd389e403d13809ecf32bd8f2164fc18c028242 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 23 Feb 2014 16:15:38 +0000 Subject: [PATCH] Colour a $VAR within "" but not within ''. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4599 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ doc/syntax/sh.nanorc | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d0e50c08..aaf2f194 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-02-23 Benno Schulenberg * doc/syntax/*.nanorc - Comment and punctuation tweaks. + * doc/syntax/sh.nanorc - Colour $VAR within a "" string + but not within a '' string, and do not colour strings + within comments. Fixes bug #29943. 2014-02-23 Benno Schulenberg * src/text.c (do_undo, do_redo, add_undo) - Make warning diff --git a/doc/syntax/sh.nanorc b/doc/syntax/sh.nanorc index f6601057..f5922339 100644 --- a/doc/syntax/sh.nanorc +++ b/doc/syntax/sh.nanorc @@ -9,7 +9,8 @@ color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" color green "-[Ldefgruwx]\>" color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>" color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>" +color brightyellow ""(\\.|[^"])*"" icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?" +color brightyellow "'(\\.|[^'])*'" color cyan "(^|[[:space:]])#.*$" -color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" color ,green "[[:space:]]+$" -- 2.39.5