From db15a2d5a0e6e776f18a9d6a3998475421fa5408 Mon Sep 17 00:00:00 2001 From: Lucius Hu <1222865+lebensterben@users.noreply.github.com> Date: Tue, 15 Feb 2022 01:24:16 +0000 Subject: [PATCH] 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. --- core/core-jump.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/core-jump.el b/core/core-jump.el index ed4397025..3ec8e3922 100644 --- a/core/core-jump.el +++ b/core/core-jump.el @@ -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)