Fix doom:scratch-or-org
This commit is contained in:
parent
9ecbc86847
commit
c9dffe6a64
1 changed files with 11 additions and 11 deletions
|
@ -265,21 +265,21 @@ buffers regardless of project."
|
||||||
:move-point nil
|
:move-point nil
|
||||||
:type inclusive
|
:type inclusive
|
||||||
(interactive "<r><!>")
|
(interactive "<r><!>")
|
||||||
(let ((mode major-mode)
|
(let ((text (when (and (evil-visual-state-p) beg end)
|
||||||
(text (when (and (evil-visual-state-p) beg end)
|
|
||||||
(buffer-substring beg end))))
|
(buffer-substring beg end))))
|
||||||
(if bang
|
(if bang
|
||||||
(org-capture-string text)
|
(org-capture-string text)
|
||||||
;; or scratch buffer by default
|
;; or scratch buffer by default
|
||||||
(with-current-buffer (doom/popup-buffer doom-buffer)
|
(let ((mode major-mode)
|
||||||
(doom|update-scratch-buffer nil t)
|
(old-project (doom/project-root))
|
||||||
|
(new-buf (get-buffer-create "*doom:scratch*")))
|
||||||
|
(with-selected-window (doom/popup-buffer new-buf)
|
||||||
|
(setq default-directory old-project)
|
||||||
|
(setq mode-line-format (doom-mode-line 'scratch))
|
||||||
(when (and (not (eq major-mode mode))
|
(when (and (not (eq major-mode mode))
|
||||||
(functionp mode))
|
(functionp mode))
|
||||||
(funcall mode))
|
(funcall mode))
|
||||||
(unless doom-buffer-edited
|
(if text (insert text)))))))
|
||||||
(erase-buffer)
|
|
||||||
(setq doom-buffer-edited t))
|
|
||||||
(if text (insert text))))))
|
|
||||||
|
|
||||||
;;;###autoload (autoload 'doom:cd "defuns-buffers" nil t)
|
;;;###autoload (autoload 'doom:cd "defuns-buffers" nil t)
|
||||||
(evil-define-command doom:cd (dir)
|
(evil-define-command doom:cd (dir)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue