Only recenter following a file or internal org link
Rather than browser or external links.
This commit is contained in:
parent
b2919ee5d6
commit
3e3f35a67d
1 changed files with 7 additions and 5 deletions
|
@ -497,11 +497,13 @@ the exported output (i.e. formatters)."
|
||||||
;; to be performant.
|
;; to be performant.
|
||||||
(setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold))
|
(setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold))
|
||||||
|
|
||||||
(add-hook! 'org-follow-link-hook
|
(defadvice! +org--recenter-after-follow-link-a (&rest _args)
|
||||||
(defun +org-delayed-recenter-h ()
|
"Recenter after following a link, but only internal or file links."
|
||||||
"`recenter', but after a tiny delay. Necessary to prevent certain race
|
:after '(org-footnote-action
|
||||||
conditions where a window's buffer hasn't changed at the time this hook is run."
|
org-follow-timestamp-link
|
||||||
(run-at-time 0.1 nil #'recenter)))
|
org-link-open-as-file
|
||||||
|
org-link-search)
|
||||||
|
(recenter))
|
||||||
|
|
||||||
(defadvice! +org--strip-properties-from-outline-a (orig-fn path &optional width prefix separator)
|
(defadvice! +org--strip-properties-from-outline-a (orig-fn path &optional width prefix separator)
|
||||||
"Remove link syntax and fix variable height text (e.g. org headings) in the
|
"Remove link syntax and fix variable height text (e.g. org headings) in the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue