nano-devel
[Top][All Lists]
Advanced

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

[PATCH] syntax: c: colorize also labels that contain digits, and uncolor


From: Benno Schulenberg
Subject: [PATCH] syntax: c: colorize also labels that contain digits, and uncolorize colon
Date: Sun, 14 Mar 2021 17:32:06 +0100

Labels may contain digits (after the first character).
And the colon after "default" should not be colored.

Inspired-by: Hussam al-Homsi <sawuare@gmail.com>
---
 syntax/c.nanorc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/syntax/c.nanorc b/syntax/c.nanorc
index 32c5b63d..5b83a184 100644
--- a/syntax/c.nanorc
+++ b/syntax/c.nanorc
@@ -8,7 +8,8 @@ comment "//"
 # Constants.
 color brightred "\<[A-Z_][0-9A-Z_]*\>"
 # Labels.
-color brightmagenta "^[[:space:]]*[A-Z_a-z]+:[[:space:]]*$"
+color brightmagenta "^\s*[A-Z_a-z][0-9A-Z_a-z]*:\s*$"
+color normal ":\s*$"
 
 # Types and related keywords.
 color green 
"\<(auto|bool|char|const|double|enum|extern|float|inline|int|long|restrict|short|signed|sizeof|static|struct|typedef|union|unsigned|void)\>"
-- 
2.29.3




reply via email to

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