fix: save-place: don't move point more than once
In some contexts, like org-agenda-switch-to visiting a TODO in an agenda file, the visiting command will move the cursor after opening the file. If save-place moves the cursor yet again, the cursor will end up in an unpredictable place.
This commit is contained in:
parent
5cc4056abf
commit
fec28a19e1
1 changed files with 5 additions and 0 deletions
|
@ -406,6 +406,11 @@ the unwritable tidbits."
|
|||
(unless doom-large-file-p
|
||||
(apply fn args)))
|
||||
|
||||
(defadvice! doom--inhibit-saveplace-if-point-not-at-bol-a (&rest _)
|
||||
"If something else has moved point, don't try to move it again."
|
||||
:before-while #'save-place-find-file-hook
|
||||
(bobp))
|
||||
|
||||
(defadvice! doom--dont-prettify-saveplace-cache-a (fn)
|
||||
"`save-place-alist-to-file' uses `pp' to prettify the contents of its cache.
|
||||
`pp' can be expensive for longer lists, and there's no reason to prettify cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue