From 635977fe33daea25205c28eba16ba2fa4cded394 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 30 May 2021 10:28:42 +0200 Subject: [PATCH] syntax: nanohelp: avoid colorizing M-) in (M-) and M-" in "M-" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- syntax/nanohelp.nanorc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/syntax/nanohelp.nanorc b/syntax/nanohelp.nanorc index 79c4b944..fdc01289 100644 --- 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])-." "\" +# 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-)'"