Do not fold property drawers in already folded areas

* lisp/org.el (org-cycle-hide-property-drawers): Do not re-fold
drawer.
This commit is contained in:
Nicolas Goaziou 2020-05-09 19:09:39 +02:00
parent 76f5cbd5a5
commit 92bc33287e

View file

@ -6143,12 +6143,16 @@ STATE should be one of the symbols listed in the docstring of
(t (save-excursion (org-end-of-subtree t)))))) (t (save-excursion (org-end-of-subtree t))))))
(org-with-point-at beg (org-with-point-at beg
(while (re-search-forward org-property-start-re (max end (point)) t) (while (re-search-forward org-property-start-re (max end (point)) t)
(pcase (get-char-property-and-overlay (line-end-position) 'invisible)
;; Do not fold already folded drawers.
(`(outline . ,o) (goto-char (overlay-end o)))
(_
(let ((start (match-end 0))) (let ((start (match-end 0)))
(when (org-at-property-drawer-p) (when (org-at-property-drawer-p)
(let ((end (re-search-forward org-property-end-re))) (let ((end (re-search-forward org-property-end-re)))
;; Property drawers use `outline' invisibility spec so ;; Property drawers use `outline' invisibility spec so
;; they can be swallowed once we hide the outline. ;; they can be swallowed once we hide the outline.
(org-flag-region start end t 'outline))))))))) (org-flag-region start end t 'outline)))))))))))
;;;; Visibility cycling ;;;; Visibility cycling