fix(cli): ensure order of subcommands in 'doom help'

They should be in insertion order. They were formerly in
reverse-insertion order.
This commit is contained in:
Henrik Lissner 2022-07-29 12:55:51 +02:00
parent a2d2206797
commit a79b2ec69e
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -314,7 +314,7 @@ OPTIONS:
(cl-defun doom-cli-help--render-commands (commands &key prefix grouped? docs? (inline? t))
(with-temp-buffer
(let* ((doom-print-indent 0)
(commands (seq-group-by (fn! (if grouped? (doom-cli-prop (doom-cli-get % t) :group))) commands))
(commands (seq-group-by (fn! (if grouped? (doom-cli-prop (doom-cli-get % t) :group))) (nreverse commands)))
(toplevel (assq nil commands))
(rest (remove toplevel commands))
(drop (if prefix (length prefix) 0))