Last active
December 3, 2019 17:36
-
-
Save joncol/1fa8bfaecba508cd0a8ea2a84bb4c97b to your computer and use it in GitHub Desktop.
place-cider-test-report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun create-test-report-window (&rest _) | |
"Create window to show test report buffer, if one exists. | |
Place it to the right of the current window. If a window for the test report | |
buffer already exists, don't create a new one." | |
(when-let* ((buf (get-buffer cider-test-report-buffer))) | |
(unless (get-buffer-window buf) | |
(let ((buffer-window (split-window (selected-window) | |
(/ (window-width) 2) | |
'right))) | |
(set-window-buffer buffer-window buf) | |
(display-buffer-record-window 'window buffer-window buf) | |
(set-window-prev-buffers buffer-window nil) | |
(select-window buffer-window))))) | |
(advice-add 'cider-test-show-report :before #'create-test-report-window) | |
(advice-add 'cider-popup-buffer :before #'create-test-report-window) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment