mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
ui/doom: remove TODO + update docstring for +doom:scratch-buffer
This commit is contained in:
@ -2,16 +2,15 @@
|
|||||||
|
|
||||||
;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload/evil" nil t)
|
;;;###autoload (autoload '+doom:scratch-buffer "ui/doom/autoload/evil" nil t)
|
||||||
(evil-define-operator +doom:scratch-buffer (&optional beg end bang)
|
(evil-define-operator +doom:scratch-buffer (&optional beg end bang)
|
||||||
"Send a region to and pop up the scratch buffer. If BANG, don't use a popup,
|
"Opens the scratch buffer in a popup window and, optionally, send the selected
|
||||||
use the current window."
|
region to it. If BANG, use current window instead of a popup."
|
||||||
:move-point nil :type inclusive
|
:move-point nil :type inclusive
|
||||||
;; TODO Test me
|
|
||||||
(interactive "<r><!>")
|
(interactive "<r><!>")
|
||||||
(let ((text (when (and (evil-visual-state-p) beg end)
|
(let ((text (when (and (evil-visual-state-p) beg end)
|
||||||
(buffer-substring beg end)))
|
(buffer-substring beg end)))
|
||||||
(mode major-mode)
|
(mode major-mode)
|
||||||
(old-project (doom-project-root))
|
(old-project (doom-project-root))
|
||||||
(new-buf (get-buffer-create "*doom:scratch*")))
|
(new-buf (get-buffer-create "*doom:scratch*")))
|
||||||
(if bang
|
(if bang
|
||||||
(switch-to-buffer new-buf)
|
(switch-to-buffer new-buf)
|
||||||
(doom-popup-buffer new-buf))
|
(doom-popup-buffer new-buf))
|
||||||
|
Reference in New Issue
Block a user