From ec78cbc00b4e2abf201149b76ce41df87869627f Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Fri, 1 Oct 2021 14:03:47 +0800 Subject: [PATCH] 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/ --- lisp/org-inlinetask.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index 3379a2e46..6320be12b 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -338,7 +338,8 @@ (defun org-inlinetask-hide-tasks (state) (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." -- 2.32.0