commit 635977fe33daea25205c28eba16ba2fa4cded394
parent 6ab70c2b0af930d94b287e43f841ff6f9c61e7b9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 30 May 2021 10:28:42 +0200
syntax: nanohelp: avoid colorizing M-) in (M-) and M-" in "M-"
Instead of quoting M- as 'M-', some translations use «M-» (Catalan),
(M-) (Croat), "M-" (Italian), „M-” (Romanian), or „М-“ (Serbian).
Those occurrences of M- nor its quotation marks should be colored.
Achieve this by excluding those quotation marks from the M- regex,
and then colorizing M-) and M-" only when at start of line (first
column of shortcuts) or when between parentheses (second column).
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/syntax/nanohelp.nanorc b/syntax/nanohelp.nanorc
@@ -4,8 +4,14 @@
syntax nanohelp
# Key combos:
-color cyan "\^[]/4-8@A-Z\^_`◀▶▲▼-]" "[◀▶▲▼]" "\<(M|S[Hh]-[Mm])-." "\<F([1-9]|1[0-9]|2[0-4])"
+color cyan "\^[]/4-8@A-Z\^_`◀▶▲▼-]" "[◀▶▲▼]" "\<(M|S[Hh]-[Mm])-[^")”»“」]" "\<F([1-9]|1[0-9]|2[0-4])"
color cyan "\<((Sh-)?Tab|Enter|Ins|(Sh-\^?)?Del|Space|Bsp|Up|Down|Left|Right|Home|End|PgUp|PgDn)\>"
+# Colorize M-) and M-" only when between parentheses...
+color cyan "\(M-(\)|")\)"
+color normal " \(|\) "
+# ...or when at start of line.
+color cyan "^M-(\)|")"
+
# Quoted indicators:
color brightred "'(\^|M-)'"