org-element--parse-to: Fix return value at the and of first section
* lisp/org-element.el (org-element--parse-to): Fix edge case when calling `org-element--parse-to' at contents end point of first section. We need to return outermost element ending before point in such scenario. Fixes https://list.orgmode.org/01bc6137-200d-8e2d-fdd7-6aad8382c619@posteo.eu/T/#u
This commit is contained in:
parent
e4ee04eeae
commit
ced2b33357
|
@ -6415,7 +6415,7 @@ If you observe Emacs hangs frequently, please report this to Org mode mailing li
|
|||
;; the headline section.
|
||||
(and (org-element--open-end-p element)
|
||||
(or (= (org-element-property :end element) (point-max))
|
||||
(and (> pos (org-element-property :contents-end element))
|
||||
(and (>= pos (org-element-property :contents-end element))
|
||||
(memq (org-element-type element) '(org-data section headline)))))))
|
||||
(goto-char (or next cbeg))
|
||||
(setq mode (if next mode (org-element--next-mode mode type t))
|
||||
|
|
Loading…
Reference in New Issue