Fix lack of syntax highlighting in :x scratch buffer

This commit is contained in:
Henrik Lissner 2017-04-25 22:56:49 -04:00
parent b2d19eac32
commit 010bc8de7b
2 changed files with 8 additions and 7 deletions

View file

@ -11,13 +11,14 @@ use the current window."
(buffer-substring beg end)))
(mode major-mode)
(old-project (doom-project-root))
(new-buf (get-buffer-create " *doom:scratch*")))
(new-buf (get-buffer-create "*doom:scratch*")))
(if bang
(switch-to-buffer new-buf)
(doom-popup-buffer new-buf))
(with-current-buffer new-buf
(setq default-directory old-project
mode-line-format (doom-modeline 'minimal))
(setq default-directory old-project)
(when (and (not (eq major-mode mode))
(functionp mode))
(funcall mode))
(if text (insert text)))
(if bang (switch-to-buffer new-buf) (doom-popup-buffer new-buf))))
(if text (insert text)))))