From f57c065e7572beb2b551d1278bf794f4af0fb0c0 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 30 Apr 2025 20:04:28 +0200 Subject: [PATCH] runtime(sh): Update syntax, highlight escaped chars in test expressions Highlight escape characters in unquoted test expression operands. E.g., [[ foo == \[bar\] ]] fixes #17221 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/sh.vim | 3 ++- runtime/syntax/testdir/dumps/sh_14_00.dump | 20 ++++++++++++++++++++ runtime/syntax/testdir/input/sh_14.sh | 8 ++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 runtime/syntax/testdir/dumps/sh_14_00.dump create mode 100644 runtime/syntax/testdir/input/sh_14.sh diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 9e5320f1ce..f0a6685b60 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -10,6 +10,7 @@ " 2025 Mar 21 update shell capability detection (#16939) " 2025 Apr 03 command substitution opening paren at EOL (#17026) " 2025 Apr 10 improve shell detection (#17084) +" 2025 Apr 29 match escaped chars in test operands (#17221) " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax @@ -306,7 +307,7 @@ syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" "======= syn region shExpr matchgroup=shRange start="\[\s\@=" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial syn region shTest transparent matchgroup=shStatement start="\