Show Org roam buffer in selected window before updating its content
This is to address the issue of malformed content in the Org roam buffer, see https://github.com/org-roam/org-roam/issues/1586. The excellent description of @camdez in [there][1] is the basis for this workaround. [1]: https://github.com/org-roam/org-roam/issues/1586#issuecomment-1412250226
This commit is contained in:
parent
4eeb5527bc
commit
18e612b447
17
init.el
17
init.el
|
@ -1267,7 +1267,22 @@
|
||||||
:bind (:map org-mode-map
|
:bind (:map org-mode-map
|
||||||
(("C-c n l" . org-roam-buffer-toggle)
|
(("C-c n l" . org-roam-buffer-toggle)
|
||||||
("C-c n g" . org-roam-graph)))
|
("C-c n g" . org-roam-graph)))
|
||||||
:config (org-roam-db-autosync-mode))
|
:config (progn
|
||||||
|
(org-roam-db-autosync-mode)
|
||||||
|
|
||||||
|
(define-advice org-roam-buffer-render-contents
|
||||||
|
(:around (orig-func) show-buffer-in-selected-window)
|
||||||
|
"Show Org roam buffer in selected window before updating its content.
|
||||||
|
|
||||||
|
See https://github.com/org-roam/org-roam/issues/1586, and in particular
|
||||||
|
https://github.com/org-roam/org-roam/issues/1586#issuecomment-1412250226.
|
||||||
|
Note that this workaround is incomplete, as explained in this comment."
|
||||||
|
(let ((org-roam-buffer-window (display-buffer (current-buffer))))
|
||||||
|
;; When we cannot display the buffer, there is also no need to
|
||||||
|
;; update it, no?
|
||||||
|
(when org-roam-buffer-window
|
||||||
|
(with-selected-window org-roam-buffer-window
|
||||||
|
(funcall orig-func)))))))
|
||||||
|
|
||||||
|
|
||||||
;; * General Programming
|
;; * General Programming
|
||||||
|
|
Loading…
Reference in New Issue
Block a user