ui/popup: respect org-src-window-setup

This commit is contained in:
Henrik Lissner 2018-08-07 14:44:10 +02:00
parent 685f282b53
commit b349dd3473
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -232,10 +232,9 @@ the command buffer."
(defun +popup*org-src-pop-to-buffer (orig-fn buffer context)
"Hand off the src-block window to the popup system by using `display-buffer'
instead of switch-to-buffer-*."
(if +popup-mode
(if (eq org-src-window-setup 'switch-invisibly) ; for internal calls
(set-buffer buffer)
(display-buffer buffer))
(if (and (eq org-src-window-setup 'other-window)
+popup-mode)
(pop-to-buffer buffer)
(funcall orig-fn buffer context)))
(advice-add #'org-src-switch-to-buffer :around #'+popup*org-src-pop-to-buffer)
(setq org-src-window-setup 'other-window)