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)))
((xref-backend-identifier-at-point (xref-find-backend)))))
(defun +lookup--jump-to (prop identifier &optional other-window)
(with-selected-window
(if other-window
(save-excursion (other-window 1) (selected-window))
(selected-window))
(let ((fn (plist-get +lookup-current-functions prop))
(origin (point-marker)))
(condition-case e
(or (if (commandp fn)
(call-interactively fn)
(funcall fn identifier))
(/= (point-marker) origin))
('error
(message "%s" e)
nil)))))
(defun +lookup--jump-to (prop identifier)
(let ((fn (plist-get +lookup-current-functions prop))
(origin (point-marker)))
(setq fn (or (command-remapping fn) fn))
(condition-case e
(or (if (commandp fn)
(call-interactively fn)
(funcall fn identifier))
(/= (point-marker) origin))
('error
(message "%s" e)
nil))))
;;