fix: Do not skip invisible headings when getting node at point. (#1798)

This commit is contained in:
Ilya Konovalov
2021-08-21 19:01:52 +03:00
committed by GitHub
parent 858f531d96
commit 04b7780ff9
2 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@
- [#1795](https://github.com/org-roam/org-roam/pull/1795) buffer: optimized reflinks fetch - [#1795](https://github.com/org-roam/org-roam/pull/1795) buffer: optimized reflinks fetch
### Fixed ### Fixed
- [#1798](https://github.com/org-roam/org-roam/pull/1798) org-roam-node-at-point: do not skip invisible headings
## 2.1.0 ## 2.1.0
### Added ### Added

View File

@ -180,7 +180,7 @@ populated."
(magit-section-up) (magit-section-up)
(org-roam-node-at-point))) (org-roam-node-at-point)))
(t (org-with-wide-buffer (t (org-with-wide-buffer
(org-back-to-heading-or-point-min) (org-back-to-heading-or-point-min t)
(while (and (not (org-roam-db-node-p)) (while (and (not (org-roam-db-node-p))
(not (bobp))) (not (bobp)))
(org-roam-up-heading-or-point-min)) (org-roam-up-heading-or-point-min))
@ -827,7 +827,7 @@ If region is active, then use it instead of the node at point."
"Convert current subtree at point to a node, and extract it into a new file." "Convert current subtree at point to a node, and extract it into a new file."
(interactive) (interactive)
(save-excursion (save-excursion
(org-back-to-heading-or-point-min) (org-back-to-heading-or-point-min t)
(when (bobp) (user-error "Already a top-level node")) (when (bobp) (user-error "Already a top-level node"))
(org-id-get-create) (org-id-get-create)
(save-buffer) (save-buffer)
@ -865,7 +865,7 @@ If region is active, then use it instead of the node at point."
Recursively traverses up the headline tree to find the Recursively traverses up the headline tree to find the
first encapsulating ID." first encapsulating ID."
(org-with-wide-buffer (org-with-wide-buffer
(org-back-to-heading-or-point-min) (org-back-to-heading-or-point-min t)
(while (and (not (org-roam-db-node-p)) (while (and (not (org-roam-db-node-p))
(not (bobp))) (not (bobp)))
(org-roam-up-heading-or-point-min)) (org-roam-up-heading-or-point-min))