Fontize $(...) slightly better in bash mode

* lisp/progmodes/sh-script.el (sh-font-lock-keywords-var): Fontize
$(...) slightly better (bug#42417).  Instead of just fontizing the
first word in the expression, fontize until the closing
parenthesis.  This doesn't work well if you have nested $(...)
expressions.
This commit is contained in:
Lars Ingebrigtsen 2020-08-05 11:34:56 +02:00
parent 3f358fc172
commit c9d550a301

View file

@ -838,7 +838,7 @@ See `sh-feature'.")
font-lock-variable-name-face))
(rc sh-append es)
(bash sh-append sh ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) ))
(bash sh-append sh ("\\$(\\([^)\n]+\\)" (1 'sh-quoted-exec t) ))
(sh sh-append shell
;; Variable names.
("\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)" 2