1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-28 07:44:49 +00:00

org-indent: Fix edge case when edited region ends at headline leading stars

* lisp/org-indent.el (org-indent-refresh-maybe): Extend affected
region to the whole line after END.

Fixes https://orgmode.org/list/t4lpos$l3p$1@ciao.gmane.io
This commit is contained in:
Ihor Radchenko 2022-05-02 11:56:15 +08:00
parent 79f0969ccc
commit 064afa0c01
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -409,7 +409,13 @@ This function is meant to be called by `after-change-functions'."
(goto-char beg)
(beginning-of-line)
(re-search-forward
(org-with-limited-levels org-outline-regexp-bol) end t)))
(org-with-limited-levels org-outline-regexp-bol)
(save-excursion
(goto-char end)
;; Extend to headline if END is within its
;; headline stars.
(line-end-position))
t)))
(let ((end (save-excursion
(goto-char end)
(org-with-limited-levels (outline-next-heading))