tools/eval: display in minibuffer if below threshold
If it's just a couple lines, display in minibuffer instead.
This commit is contained in:
parent
36c9f7c333
commit
d2fe021bd9
1 changed files with 19 additions and 14 deletions
|
@ -3,20 +3,25 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eval-display-results-in-popup (output &optional source-buffer)
|
(defun +eval-display-results-in-popup (output &optional source-buffer)
|
||||||
"Display OUTPUT in a popup buffer."
|
"Display OUTPUT in a popup buffer."
|
||||||
(let ((output-buffer (get-buffer-create "*doom eval*"))
|
(if (with-temp-buffer
|
||||||
(origin (selected-window)))
|
(insert output)
|
||||||
(with-current-buffer output-buffer
|
(>= (count-lines (point-min) (point-max))
|
||||||
(setq-local scroll-margin 0)
|
+eval-overlay-max-lines))
|
||||||
(erase-buffer)
|
(let ((output-buffer (get-buffer-create "*doom eval*"))
|
||||||
(insert output)
|
(origin (selected-window)))
|
||||||
(goto-char (point-min))
|
(with-current-buffer output-buffer
|
||||||
(if (fboundp '+word-wrap-mode)
|
(setq-local scroll-margin 0)
|
||||||
(+word-wrap-mode +1)
|
(erase-buffer)
|
||||||
(visual-line-mode +1)))
|
(insert output)
|
||||||
(when-let (win (display-buffer output-buffer))
|
(goto-char (point-min))
|
||||||
(fit-window-to-buffer win))
|
(if (fboundp '+word-wrap-mode)
|
||||||
(select-window origin)
|
(+word-wrap-mode +1)
|
||||||
output-buffer))
|
(visual-line-mode +1)))
|
||||||
|
(when-let (win (display-buffer output-buffer))
|
||||||
|
(fit-window-to-buffer win))
|
||||||
|
(select-window origin)
|
||||||
|
output-buffer)
|
||||||
|
(message "%s" output)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eval-display-results-in-overlay (output &optional source-buffer)
|
(defun +eval-display-results-in-overlay (output &optional source-buffer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue