Fix quickrun output popups being too small

There is no guarantee that the quickrun buffer will have all its output
when spawned, making :autofit unpredictable; usually making them too
small, so we disable :autofit and do it manually, once the output is
ready.
This commit is contained in:
Henrik Lissner 2017-10-03 15:46:38 +02:00
parent 5358488300
commit bdea695b5a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -70,7 +70,7 @@ function that creates and returns the REPL buffer."
(unless (boundp 'display-line-numbers) (unless (boundp 'display-line-numbers)
(add-hook 'quickrun--mode-hook #'nlinum-mode)) (add-hook 'quickrun--mode-hook #'nlinum-mode))
:config :config
(set! :popup "*quickrun*" :size 3 :autokill t :autoclose t :autofit t) (set! :popup "*quickrun*" :size 6 :autokill t :autoclose t)
(defun +eval*quickrun-auto-close (&rest _) (defun +eval*quickrun-auto-close (&rest _)
"Allows us to silently re-run quickrun from within the quickrun buffer." "Allows us to silently re-run quickrun from within the quickrun buffer."
@ -85,6 +85,7 @@ function that creates and returns the REPL buffer."
(defun +eval|quickrun-scroll-to-bof () (defun +eval|quickrun-scroll-to-bof ()
"Ensures window is scrolled to BOF on invocation." "Ensures window is scrolled to BOF on invocation."
(with-selected-window (get-buffer-window quickrun--buffer-name) (with-selected-window (get-buffer-window quickrun--buffer-name)
(goto-char (point-min)))) (goto-char (point-min))
(doom-popup-fit-to-buffer)))
(add-hook 'quickrun-after-run-hook #'+eval|quickrun-scroll-to-bof)) (add-hook 'quickrun-after-run-hook #'+eval|quickrun-scroll-to-bof))