feature/lookup: fix some windows not grabbing focus after lookups

This commit is contained in:
Henrik Lissner 2018-03-26 02:52:50 -04:00
parent b848527f0c
commit d06d4c4dde
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -24,21 +24,18 @@
(region-end))) (region-end)))
((xref-backend-identifier-at-point (xref-find-backend))))) ((xref-backend-identifier-at-point (xref-find-backend)))))
(defun +lookup--jump-to (prop identifier &optional other-window) (defun +lookup--jump-to (prop identifier)
(with-selected-window (let ((fn (plist-get +lookup-current-functions prop))
(if other-window (origin (point-marker)))
(save-excursion (other-window 1) (selected-window)) (setq fn (or (command-remapping fn) fn))
(selected-window)) (condition-case e
(let ((fn (plist-get +lookup-current-functions prop)) (or (if (commandp fn)
(origin (point-marker))) (call-interactively fn)
(condition-case e (funcall fn identifier))
(or (if (commandp fn) (/= (point-marker) origin))
(call-interactively fn) ('error
(funcall fn identifier)) (message "%s" e)
(/= (point-marker) origin)) nil))))
('error
(message "%s" e)
nil)))))
;; ;;