branch: externals-release/org
commit a25d00d5dff6c162b1bb7542201c590052d267fa
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
org-return: Do not insert inside folded region
* lisp/org.el (org--newline): When called interactively, check for
invisible edits.
Reported-by: Kaiyu Zheng <[email protected]>
Link: https://orgmode.org/list/87wmxs8hxt.fsf@localhost
---
lisp/org.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/org.el b/lisp/org.el
index c5c0808104..02a0813392 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17663,6 +17663,8 @@ If INDENT is non-nil, call `newline-and-indent' with
ARG to
indent unconditionally; otherwise, call `newline' with ARG and
INTERACTIVE, which can trigger indentation if
`electric-indent-mode' is enabled."
+ (when interactive
+ (org-fold-check-before-invisible-edit 'insert))
(if indent
(org-newline-and-indent arg)
(newline arg interactive)))