Prevent scrolling on magit refresh & toc-org

This commit is contained in:
Henrik Lissner 2020-04-04 00:30:14 -04:00
parent a381f59261
commit 2ceac53421
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 26 additions and 1 deletions

View file

@ -746,7 +746,18 @@ compelling reason, so..."
(use-package! toc-org ; auto-table of contents
:hook (org-mode . toc-org-enable)
:config (setq toc-org-hrefify-default "gh"))
:config
(setq toc-org-hrefify-default "gh")
(defadvice! +org-inhibit-scrolling-a (orig-fn &rest args)
"Prevent the jarring scrolling that occurs when the-ToC is regenerated."
:around #'toc-org-insert-toc
(let ((p (set-marker (make-marker) (point)))
(s (window-start)))
(prog1 (apply orig-fn args)
(goto-char p)
(set-window-start nil s t)
(set-marker p nil)))))
(use-package! org-bullets ; "prettier" bullets