1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 07:11:34 -08:00

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)
This commit is contained in:
Jostein Kjønigsen 2025-04-30 11:33:26 +02:00 committed by Eli Zaretskii
parent 013ed9799e
commit 7265be09ce

View file

@ -3369,7 +3369,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