forked from mirrors/org-mode
org-fold-core-previous-visibility-change: Fix edge case
* lisp/org-fold-core.el (org-fold-core-next-visibility-change): Take into account that `previous-single-char-property-change' move the point to the first position where the property is still unchanged. * lisp/org-cycle.el (org-cycle-set-visibility-according-to-property): Ignore invisibility when skipping subtree. Reported-by: Philipp Kiefer <phil.kiefer@gmail.com> Link: https://orgmode.org/list/96becf12-9a5a-2fc2-0105-a41528be1f66@gmail.com
This commit is contained in:
parent
715f74db36
commit
18a146a9d5
|
@ -658,7 +658,7 @@ With a numeric prefix, show all headlines up to that level."
|
||||||
((or "all" "showall")
|
((or "all" "showall")
|
||||||
(org-fold-show-subtree))
|
(org-fold-show-subtree))
|
||||||
(_ nil)))
|
(_ nil)))
|
||||||
(org-end-of-subtree)))))))
|
(org-end-of-subtree t)))))))
|
||||||
|
|
||||||
(defun org-cycle-overview ()
|
(defun org-cycle-overview ()
|
||||||
"Switch to overview mode, showing only top-level headlines."
|
"Switch to overview mode, showing only top-level headlines."
|
||||||
|
|
|
@ -835,13 +835,20 @@ If PREVIOUS-P is non-nil, search backwards."
|
||||||
(next-change (if previous-p
|
(next-change (if previous-p
|
||||||
(if ignore-hidden-p
|
(if ignore-hidden-p
|
||||||
(lambda (p) (org-fold-core-previous-folding-state-change (org-fold-core-get-folding-spec nil p) p limit))
|
(lambda (p) (org-fold-core-previous-folding-state-change (org-fold-core-get-folding-spec nil p) p limit))
|
||||||
(lambda (p) (max limit (1- (previous-single-char-property-change p 'invisible nil limit)))))
|
(lambda (p) (max limit (previous-single-char-property-change p 'invisible nil limit))))
|
||||||
(if ignore-hidden-p
|
(if ignore-hidden-p
|
||||||
(lambda (p) (org-fold-core-next-folding-state-change (org-fold-core-get-folding-spec nil p) p limit))
|
(lambda (p) (org-fold-core-next-folding-state-change (org-fold-core-get-folding-spec nil p) p limit))
|
||||||
(lambda (p) (next-single-char-property-change p 'invisible nil limit)))))
|
(lambda (p) (next-single-char-property-change p 'invisible nil limit)))))
|
||||||
(next pos))
|
(next pos))
|
||||||
(while (and (funcall cmp next limit)
|
(while (and (funcall cmp next limit)
|
||||||
(not (org-xor invisible-initially? (funcall invisible-p next))))
|
(not (org-xor
|
||||||
|
invisible-initially?
|
||||||
|
(funcall invisible-p
|
||||||
|
(if previous-p
|
||||||
|
;; NEXT-1 -> NEXT is the change.
|
||||||
|
(max limit (1- next))
|
||||||
|
;; NEXT -> NEXT+1 is the change.
|
||||||
|
next)))))
|
||||||
(setq next (funcall next-change next)))
|
(setq next (funcall next-change next)))
|
||||||
next))
|
next))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue