Browse Source

org-fold: Do not fold text inserted right after outline fold

* lisp/org-fold.el (org-fold-initialize): Do not extend the fold when
text is inserted right after it.  This resembles folding overlay
behavior used in previous Org versions and in the 'overlays
`org-fold-core-style'.

Fixes https://orgmode.org/list/871quprrra.fsf@gmail.com
Ihor Radchenko 2 years ago
parent
commit
39005dc098
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/org-fold.el

+ 4 - 2
lisp/org-fold.el

@@ -223,9 +223,11 @@ smart            Make point visible, and do insertion/deletion if it is
       (:isearch-open . t)
       ;; This is needed to make sure that inserting a
       ;; new planning line in folded heading is not
-      ;; revealed.
+      ;; revealed.  Also, the below combination of :font-sticky and
+      ;; :real-sticky conforms to the overlay properties in outline.el
+      ;; and the older Org versions as in `outline-flag-region'.
       (:front-sticky . t)
-      (:rear-sticky . t)
+      (:rear-sticky . nil)
       (:font-lock-skip . t)
       (:alias . (headline heading outline inlinetask plain-list)))
      (org-fold-block