mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
quickrun: kill temp buffer and refactor doom*quickrun-close-popup
This commit is contained in:
@ -62,7 +62,8 @@ elisp buffer). Otherwise forward the region to Quickrun."
|
|||||||
(setq lines (count-lines (point-min) (point-max)))
|
(setq lines (count-lines (point-min) (point-max)))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(when (< lines 5)
|
(when (< lines 5)
|
||||||
(message "%s" (buffer-substring (point-min) (point-max)))))
|
(message "%s" (buffer-substring (point-min) (point-max)))
|
||||||
|
(kill-buffer buf)))
|
||||||
(unless (< lines 5)
|
(unless (< lines 5)
|
||||||
(doom/popup-buffer buf)))))
|
(doom/popup-buffer buf)))))
|
||||||
(t (quickrun-region beg end))))
|
(t (quickrun-region beg end))))
|
||||||
@ -82,12 +83,9 @@ elisp buffer). Otherwise forward the region to Quickrun."
|
|||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom*quickrun-close-popup (&optional _ _ _ _)
|
(defun doom*quickrun-close-popup (&optional _ _ _ _)
|
||||||
"Allows us to re-run quickrun from inside the quickrun buffer."
|
"Allows us to re-run quickrun from inside the quickrun buffer."
|
||||||
(let ((buffer (get-buffer quickrun/buffer-name))
|
(awhen (get-buffer-window quickrun/buffer-name)
|
||||||
window)
|
(shut-up! (quickrun/kill-running-process))
|
||||||
(when buffer
|
(doom/popup-close it nil t)))
|
||||||
(setq window (get-buffer-window buffer))
|
|
||||||
(shut-up! (quickrun/kill-running-process))
|
|
||||||
(doom/popup-close window nil t))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom|quickrun-after-run ()
|
(defun doom|quickrun-after-run ()
|
||||||
|
Reference in New Issue
Block a user