Kaynağa Gözat

lisp/org.el: Fix bug about inserting a heading before the first headline

* lisp/org.el (org-insert-heading): Fix bug when inserting a
heading before the first headline.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/875z73br32.fsf@gmail.com/
Bastien Guerry 4 yıl önce
ebeveyn
işleme
fb30301888
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1 0
      lisp/org.el

+ 1 - 0
lisp/org.el

@@ -6947,6 +6947,7 @@ unconditionally."
 	 (when (equal arg '(16)) (org-up-heading-safe))
 	 (org-end-of-subtree)))
       (unless (bolp) (insert "\n"))
+      (unless level (backward-char))
       (unless (and blank? (org-previous-line-empty-p))
 	(org-N-empty-lines-before-current (if blank? 1 0)))
       (insert stars " ")