From: Jostein Kjønigsen Date: Wed, 30 Apr 2025 09:33:26 +0000 (+0200) Subject: sh-script.el: Improve consistency in variable-use fontification. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d6c6853ba91bf3bde019642f1ac02b0d604596d4;p=emacs.git sh-script.el: Improve consistency in variable-use fontification. sh-mode--treesit-settings: Ensure all variable use is treated the same way. Before this patch the following commands would all be treated differently: echo "${var}" echo "$var" echo ${var} echo $var Now they are treated the same. * lisp/progmodes/sh-script.el (sh-mode--treesit-settings): Tweak rules. (Bug#78167) (cherry picked from commit 7265be09cebc9ee752b688b7a85fb1ac18b45ef5) --- diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 39b93304f8d..aa55bb1fb7d 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -3386,7 +3386,11 @@ See `sh-mode--treesit-other-keywords' and :language 'bash :override t '((command_substitution) @sh-quoted-exec - (string (expansion (variable_name) @font-lock-variable-use-face))) + (expansion (variable_name) @font-lock-variable-use-face) + (expansion ["${" "}"] @font-lock-bracket-face) + (simple_expansion + "$" @font-lock-bracket-face + (variable_name) @font-lock-variable-use-face)) :feature 'heredoc :language 'bash