Preserve cursor position for scratch buffer
Not across restarts, but across toggles of the scratch popup.
This commit is contained in:
parent
505ca8712d
commit
da3e24e686
1 changed files with 5 additions and 3 deletions
|
@ -35,9 +35,11 @@ following:
|
||||||
doom-scratch-dir)))
|
doom-scratch-dir)))
|
||||||
(make-directory doom-scratch-dir t)
|
(make-directory doom-scratch-dir t)
|
||||||
(when (file-readable-p scratch-file)
|
(when (file-readable-p scratch-file)
|
||||||
(erase-buffer)
|
(let ((pt (point)))
|
||||||
(insert-file-contents scratch-file)
|
(erase-buffer)
|
||||||
(set-auto-mode)
|
(insert-file-contents scratch-file)
|
||||||
|
(set-auto-mode)
|
||||||
|
(goto-char pt))
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue