瀏覽代碼

Bugfix: Swapping the last two subtrees in a file.

Rustom Mody writes:

>  The last two lines of my org file are
>
>  *** Vishnu Sahasranam
>  *** Ram Navami
>
>  without a newline at the end
>
>  Trying to reorder these two lines I do a M-S-down on second last
>  line I get
>
>  *** Ram Navami*** Vishnu Sahasranam
Carsten Dominik 16 年之前
父節點
當前提交
95f4088990
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 2 0
      lisp/ChangeLog
  2. 1 0
      lisp/org.el

+ 2 - 0
lisp/ChangeLog

@@ -2,6 +2,8 @@
 
 	* org.el (org-modules): Add org-inlinetasks.el
 	(org-cycle): Implement limiting level on cycling.
+	(org-move-subtree-down): Fix bug with swapping subtrees at end of
+	buffer.
 
 	* org-inlinetask.el: New file.
 

+ 1 - 0
lisp/org.el

@@ -5609,6 +5609,7 @@ is signaled in this case."
     (delete-region beg end)
     (or (= beg (point-min)) (outline-flag-region (1- beg) beg nil))
     (or (bobp) (outline-flag-region (1- (point)) (point) nil))
+    (and (not (bolp)) (looking-at "\n") (forward-char 1))
     (let ((bbb (point)))
       (insert-before-markers txt)
       (org-reinstall-markers-in-region bbb)