; Fix completion of variables in Eshell immediately after "$"

* lisp/eshell/esh-var.el (eshell-complete-variable-reference): Match
group 1 even when there's nothing after "$".
This commit is contained in:
Jim Porter 2024-10-06 15:19:13 -07:00
parent 8c5d69998e
commit 49325e1356

View file

@ -840,10 +840,10 @@ START and END."
(let ((arg (pcomplete-actual-arg)))
(when (string-match
(rx "$" (? (or "#" "@"))
(? (or (group-n 1 (regexp eshell-variable-name-regexp)
string-end)
(seq (group-n 2 (or "'" "\""))
(group-n 1 (+ anychar))))))
(or (group-n 1 (? (regexp eshell-variable-name-regexp))
string-end)
(seq (group-n 2 (or "'" "\""))
(group-n 1 (+ anychar)))))
arg)
(setq pcomplete-stub (substring arg (match-beginning 1)))
(let ((delimiter (match-string 2 arg)))