Commit 83095a89 authored by Dmitry Gutov's avatar Dmitry Gutov

Fix regressions in xref-find-definitions and ...-other-window

* lisp/progmodes/xref.el:
(xref--display-buffer-in-other-window)
(xref--display-buffer-in-window): New functions.
(xref--show-pos-in-buf): Use them (bug#33870)
parent cdd8cb3a
Pipeline #2096 failed with stage
in 51 minutes and 25 seconds
......@@ -492,13 +492,14 @@ and finally return the window."
(cond ((eq xref--original-window-intent 'frame)
t)
((eq xref--original-window-intent 'window)
'(display-buffer-same-window))
`((xref--display-buffer-in-other-window)
(window . ,xref--original-window)))
((and
(window-live-p xref--original-window)
(or (not (window-dedicated-p xref--original-window))
(eq (window-buffer xref--original-window) buf)))
`((display-buffer-in-previous-window)
(previous-window . ,xref--original-window))))))
`((xref--display-buffer-in-window)
(window . ,xref--original-window))))))
(with-selected-window (display-buffer buf action)
(xref--goto-char pos)
(run-hooks 'xref-after-jump-hook)
......@@ -507,6 +508,19 @@ and finally return the window."
(setq-local other-window-scroll-buffer buf)))
(selected-window))))
(defun xref--display-buffer-in-other-window (buffer alist)
(let ((window (assoc-default 'window alist)))
(cl-assert window)
(xref--with-dedicated-window
(with-selected-window window
(display-buffer buffer t)))))
(defun xref--display-buffer-in-window (buffer alist)
(let ((window (assoc-default 'window alist)))
(cl-assert window)
(with-selected-window window
(display-buffer buffer '(display-buffer-same-window)))))
(defun xref--show-location (location &optional select)
"Help `xref-show-xref' and `xref-goto-xref' do their job.
Go to LOCATION and if SELECT is non-nil select its window. If
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment