core-jump: fixed a typo

For example, in `rust-mode`, `(spacemacs//get-jump-handlers)` returns
`((lsp-ui-peek-find-definitions :async t) evil-goto-definition)`.

So `-handler` is bound to the first one, i.e. `(lsp-ui-peek-find-definitions :async t)`.
We need to figure out whether it's asynchronous by checking the `:async` keyword argument.

But before this commit, we wrongly checks the second handler in the handlers list.
Even when multiple handlers do exist and they are all async, the typo made it sub-optimal since it uses not the best handler.

This commit fixes that.
This commit is contained in:
Lucius Hu 2022-02-15 01:24:16 +00:00 committed by GitHub
parent 0bdddfc165
commit db15a2d5a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,9 +76,8 @@ They are in order: `spacemacs-jump-handlers',
(let ((old-buffer (current-buffer))
(old-point (point)))
(dolist (-handler (spacemacs//get-jump-handlers))
(let ((handler (if (listp -handler) (car -handler) -handler))
(async (when (listp -handler)
(plist-get (cdr -handler) :async))))
(let* ((handler (if (listp -handler) (car -handler) -handler))
(async (plist-get (cdr handler) :async)))
(ignore-errors
(call-interactively handler))
(when (or (eq async t)