tools/eval: fix popup when +overlay is disabled

This commit is contained in:
Henrik Lissner 2019-10-26 03:53:54 -04:00
parent f6df219544
commit 36c9f7c333
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -21,6 +21,7 @@
;;;###autoload ;;;###autoload
(defun +eval-display-results-in-overlay (output &optional source-buffer) (defun +eval-display-results-in-overlay (output &optional source-buffer)
"Display OUTPUT in a floating overlay next to the cursor." "Display OUTPUT in a floating overlay next to the cursor."
(require 'eros)
(let ((this-command #'+eval/buffer-or-region) (let ((this-command #'+eval/buffer-or-region)
eros-overlays-use-font-lock) eros-overlays-use-font-lock)
(with-current-buffer (or source-buffer (current-buffer)) (with-current-buffer (or source-buffer (current-buffer))
@ -31,12 +32,12 @@
;;;###autoload ;;;###autoload
(defun +eval-display-results (output &optional source-buffer) (defun +eval-display-results (output &optional source-buffer)
"Display OUTPUT in an overlay or a popup buffer." "Display OUTPUT in an overlay or a popup buffer."
(funcall (if (and (or current-prefix-arg (funcall (if (or current-prefix-arg
(with-temp-buffer (with-temp-buffer
(insert output) (insert output)
(>= (count-lines (point-min) (point-max)) (>= (count-lines (point-min) (point-max))
+eval-overlay-max-lines))) +eval-overlay-max-lines))
(require 'eros nil t)) (not (require 'eros nil t)))
#'+eval-display-results-in-popup #'+eval-display-results-in-popup
#'+eval-display-results-in-overlay) #'+eval-display-results-in-overlay)
output source-buffer) output source-buffer)