org-inlinetask.el: Fix visibility cycling for inlinetasks

* lisp/org-inlinetask.el (org-inlinetask-hide-tasks): Make sure that
we loop over inlinetasks inside current section only.
`org-inlinetask-goto-end' moves point to the end of the inlinetask
element.  If an inlinetask is followed by a heading, the function
logic will treat the heading as the beginning of another inline task.
Prevent it by moving the point at the end of the END line of the
inlinetask.

Fixes
https://list.orgmode.org/orgmode/CAP7OBx+rs-7v4jstEFYC4u0=0NZ3xJKfb3CNrWeDvjmwRTvgxw@mail.gmail.com/
This commit is contained in:
Ihor Radchenko 2021-10-01 14:03:47 +08:00
parent 2063596b90
commit 5f184b5f23
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -358,7 +358,8 @@ This function is meant to be used in `org-cycle-hook'."
(or (org-inlinetask-at-task-p)
(and (outline-next-heading) (org-inlinetask-at-task-p)))
(org-inlinetask-toggle-visibility)
(org-inlinetask-goto-end))))))
(org-inlinetask-goto-end)
(backward-char))))))
(defun org-inlinetask-remove-END-maybe ()
"Remove an END line when present."