Skip to content

Commit

Permalink
org-indent: Fix edge case when edited region ends at headline leading…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Ihor Radchenko committed Jul 17, 2022
1 parent 79f0969 commit 064afa0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lisp/org-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 064afa0

Please sign in to comment.