Browse Source

Fix heading insertion with C-RET when inline tasks are involved

* lisp/org.el (org-insert-heading): Skip inline tasks when trying to
insert a new heading after the end of the subtree.
Carsten Dominik 14 years ago
parent
commit
19d695ef8f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      lisp/org.el

+ 6 - 0
lisp/org.el

@@ -6748,6 +6748,12 @@ This is important for non-interactive uses of the command."
 	    (cond
 	     (org-insert-heading-respect-content
 	      (org-end-of-subtree nil t)
+	      (when (featurep 'org-inlinetask)
+		(while (and (not (eobp))
+			    (looking-at "\\(\\*+\\)[ \t]+")
+			    (>= (length (match-string 1))
+				org-inlinetask-min-level))
+		  (org-end-of-subtree nil t)))
 	      (or (bolp) (newline))
 	      (or (org-previous-line-empty-p)
 		  (and blank (newline)))