Don’t break asynchronous jumpers (fix #6898)
This commit is contained in:
parent
131e0faef9
commit
734c87fb24
|
@ -42,12 +42,16 @@ sets `spacemacs-jump-handlers' in buffers of that mode."
|
|||
(catch 'done
|
||||
(let ((old-buffer (current-buffer))
|
||||
(old-point (point)))
|
||||
(dolist (handler spacemacs-jump-handlers)
|
||||
(ignore-errors
|
||||
(call-interactively handler))
|
||||
(unless (and (eq old-point (point))
|
||||
(equal old-buffer (current-buffer)))
|
||||
(throw 'done t))))
|
||||
(dolist (-handler spacemacs-jump-handlers)
|
||||
(let ((handler (if (listp -handler) (car -handler) -handler))
|
||||
(async (when (listp -handler)
|
||||
(plist-get (cdr -handler) :async))))
|
||||
(ignore-errors
|
||||
(call-interactively handler))
|
||||
(when (or async
|
||||
(not (eq old-point (point)))
|
||||
(not (equal old-buffer (current-buffer))))
|
||||
(throw 'done t)))))
|
||||
(message "No jump handler was able to find this symbol.")))
|
||||
|
||||
;; Set the `:jump' property manually instead of just using `evil-define-motion'
|
||||
|
|
|
@ -125,8 +125,8 @@
|
|||
|
||||
(defun c-c++/post-init-ycmd ()
|
||||
(add-hook 'c++-mode-hook 'ycmd-mode)
|
||||
(add-hook 'spacemacs-jump-handlers-c++-mode 'ycmd-goto)
|
||||
(add-hook 'spacemacs-jump-handlers-c-mode 'ycmd-goto)
|
||||
(add-hook 'spacemacs-jump-handlers-c++-mode '(ycmd-goto :async t))
|
||||
(add-hook 'spacemacs-jump-handlers-c-mode '(ycmd-goto :async t))
|
||||
(dolist (mode '(c++-mode c-mode))
|
||||
(spacemacs/set-leader-keys-for-major-mode mode
|
||||
"gG" 'ycmd-goto-imprecise)))
|
||||
|
|
Loading…
Reference in a new issue