Ver Fonte

org-tree-to-indirect-buffer: Fix when last headline is empty at point-max

* lisp/org.el (org-tree-to-indirect-buffer): Consider scenario when
`org-end-of-subtree' with 't second arg moves to `point-max' at the
end of an empty headline.  We do not need to move back the point then.

Fixes https://orgmode.org/list/CA+AFVDUF3RzA-mnoAp8yFv-bppoYJfJo=Wa8qmNQhV-tfHHB+w@mail.gmail.com
Ihor Radchenko há 3 anos atrás
pai
commit
7ec9e37117
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      lisp/org.el

+ 1 - 1
lisp/org.el

@@ -6905,7 +6905,7 @@ frame is not changed."
       (setq beg (point)
 	    heading (org-get-heading 'no-tags))
       (org-end-of-subtree t t)
-      (when (org-at-heading-p) (backward-char 1))
+      (when (and (not (eobp)) (org-at-heading-p)) (backward-char 1))
       (setq end (point)))
     (when (and (buffer-live-p org-last-indirect-buffer)
 	       (not (eq org-indirect-buffer-display 'new-frame))