fix: Infinite loop for last element in file
org-element-and-children-at-point was comparing the current point <= end, but should've been <. Fixes #17
This commit is contained in:
parent
603f614c35
commit
9d83cb22a1
1 changed files with 3 additions and 2 deletions
|
@ -257,13 +257,14 @@ If set to nil, will never create stories with labels")
|
|||
|
||||
(defun org-element-and-children-at-point ()
|
||||
(let* ((elt (org-element-find-headline))
|
||||
(contents-begin (plist-get elt :contents-begin))
|
||||
(contents-begin (or (plist-get elt :contents-begin)
|
||||
(plist-get elt :begin)))
|
||||
(end (plist-get elt :end))
|
||||
(level (plist-get elt :level))
|
||||
(children '()))
|
||||
(save-excursion
|
||||
(goto-char (+ contents-begin (length (plist-get elt :title))))
|
||||
(while (<= (point) end)
|
||||
(while (< (point) end)
|
||||
(let* ((next-elt (org-element-at-point))
|
||||
(elt-type (car next-elt))
|
||||
(elt (cadr next-elt)))
|
||||
|
|
Loading…
Reference in a new issue