mirror of
git://git.sv.gnu.org/nano.git
synced 2024-12-30 22:24:41 +03:00
635977fe33
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).
18 lines
594 B
Plaintext
18 lines
594 B
Plaintext
## This is meant for highlighting key combos in a nano help text.
|
|
|
|
# It should not apply to any normal file, so no fileregex.
|
|
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 "\<((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-)'"
|