fix(org): check org-fold-outline in invisible property

Fix: #7206
This commit is contained in:
StrawberryTea 2023-09-06 07:27:35 -05:00 committed by GitHub
parent 20393c7074
commit 3cafa0223e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -168,7 +168,8 @@ selection of all minor-modes, active or not."
(location (location
(goto-char location))) (goto-char location)))
(ignore-errors (ignore-errors
(when (outline-invisible-p) (when (memq (get-char-property (point) 'invisible)
'(outline org-fold-outline))
(save-excursion (save-excursion
(outline-previous-visible-heading 1) (outline-previous-visible-heading 1)
(org-show-subtree)))))) (org-show-subtree))))))

View file

@ -371,7 +371,9 @@ see how ARG affects this command."
(goto-char (point-min)) (goto-char (point-min))
(while (not (eobp)) (while (not (eobp))
(org-next-visible-heading 1) (org-next-visible-heading 1)
(when (outline-invisible-p (line-end-position)) (when (memq (get-char-property (line-end-position)
'invisible)
'(outline org-fold-outline))
(let ((level (org-outline-level))) (let ((level (org-outline-level)))
(when (> level max) (when (> level max)
(setq max level)))))) (setq max level))))))
@ -489,7 +491,10 @@ All my (performant) foldings needs are met between this and `org-show-subtree'
(or org-cycle-open-archived-trees (or org-cycle-open-archived-trees
(not (member org-archive-tag (org-get-tags)))) (not (member org-archive-tag (org-get-tags))))
(or (not arg) (or (not arg)
(setq invisible-p (outline-invisible-p (line-end-position))))) (setq invisible-p
(memq (get-char-property (line-end-position)
'invisible)
'(outline org-fold-outline)))))
(unless invisible-p (unless invisible-p
(setq org-cycle-subtree-status 'subtree)) (setq org-cycle-subtree-status 'subtree))
(org-cycle-internal-local) (org-cycle-internal-local)