mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Preserve cursor position for scratch buffer
Not across restarts, but across toggles of the scratch popup.
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user