[Fix #2151] org-roam-preview-default-function doesn't copy next node (#2152)

This commit is contained in:
Ahmed Shariff
2022-04-09 19:17:53 -04:00
committed by GitHub
parent fee008cdfb
commit 3bb45afccb
2 changed files with 7 additions and 4 deletions

View File

@ -7,6 +7,7 @@
### Removed
### Fixed
- [#2130](https://github.com/org-roam/org-roam/pull/2130) buffer: unlinked-references section now also searches within symlinked directories
- [#2152](https://github.com/org-roam/org-roam/pull/2152) org-roam-preview-default-function: doesn't copy copy content of next heading node when current node's content is empty
### Changed

View File

@ -449,10 +449,12 @@ In interactive calls OTHER-WINDOW is set with
This function returns the all contents under the current
headline, up to the next headline."
(let ((beg (progn (org-roam-end-of-meta-data t)
(point)))
(end (progn (org-next-visible-heading 1)
(point))))
(let ((beg (save-excursion
(org-roam-end-of-meta-data t)
(point)))
(end (save-excursion
(org-next-visible-heading 1)
(point))))
(string-trim (buffer-substring-no-properties beg end))))
(defun org-roam-preview-get-contents (file pt)