Fix outline-end-of-subtree at end of buffer

When a subtree is at the end of the buffer and followed by a
newline, flagging the subtree as invisible incorrectly swallows
the final newline.

* lisp/outline.el (outline-end-of-subtree): Check for eobp
to ensure the function steps back over the final newline when
the subtree ends at the end of the buffer (bug#80917).
This commit is contained in:
James Cherti 2026-04-27 11:14:56 -04:00 committed by Juri Linkov
parent e7e9c55ba7
commit 8decb653ff

View file

@ -1374,7 +1374,7 @@ This also unhides the top heading-less body, if any."
(or first (> (funcall outline-level) level)))
(setq first nil)
(outline-next-heading))
(if (and (bolp) (not (eolp)))
(if (or (eobp) (and (bolp) (not (eolp))))
;; We stopped at a nonempty line (the next heading).
(outline--end-of-previous))))