From c9b655f2739e09962e99cee689f372cd8b928cd4 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Tue, 12 Mar 2024 15:40:37 +0300 Subject: [PATCH] org-activate-folds: Skip over folded newlines faster * lisp/org.el (org-activate-folds): When searching next unfolded newline skip over folded newlines faster, using org-fold-core API. --- lisp/org.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/org.el b/lisp/org.el index 33d90506b..40a100fd4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5812,6 +5812,7 @@ highlighting was done, nil otherwise." "Arrange trailing newlines after folds to inherit face before the fold." (let ((next-unfolded-newline (search-forward "\n" limit 'move))) (while (and next-unfolded-newline (org-fold-folded-p) (not (eobp))) + (goto-char (org-fold-core-next-visibility-change nil limit)) (setq next-unfolded-newline (search-forward "\n" limit 'move))) (when next-unfolded-newline (org-with-wide-buffer