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).
master
Benno Schulenberg 2021-05-30 10:28:42 +02:00
parent 6ab70c2b0a
commit 635977fe33
1 changed files with 7 additions and 1 deletions

View File

@ -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-)'"