Nicolas Goaziou 8 лет назад
Родитель
Сommit
65e4370d46
2 измененных файлов с 12 добавлено и 1 удалено
  1. 0 1
      lisp/org.el
  2. 12 0
      testing/lisp/test-org.el

+ 0 - 1
lisp/org.el

@@ -7784,7 +7784,6 @@ command.
 When optional argument TOP is non-nil, insert a level 1 heading,
 unconditionally."
   (interactive "P")
-  (when (org-called-interactively-p 'any) (org-reveal))
   (let ((itemp (and (not top) (org-in-item-p)))
 	(may-split (org-get-alist-option org-M-RET-may-split-line 'headline))
 	(respect-content (or org-insert-heading-respect-content

+ 12 - 0
testing/lisp/test-org.el

@@ -1191,6 +1191,18 @@
 	    (goto-char (point-max))
 	    (let ((org-insert-heading-respect-content nil)) (org-insert-heading))
 	    (buffer-string))))
+  ;; Preserve list visibility when inserting an item.
+  (should
+   (equal
+    '(outline outline)
+    (org-test-with-temp-text "- A\n  - B\n- C\n  - D"
+      (let ((org-cycle-include-plain-lists t))
+	(org-cycle)
+	(forward-line 2)
+	(org-cycle)
+	(let ((org-insert-heading-respect-content nil)) (org-insert-heading))
+	(list (get-char-property (line-beginning-position 0) 'invisible)
+	      (get-char-property (line-end-position 2) 'invisible))))))
   ;; When called with two universal arguments, insert a new headline
   ;; at the end of the grandparent subtree.
   (should