Skip to content

Commit 064afa0

Browse files
committed
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
1 parent 79f0969 commit 064afa0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lisp/org-indent.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,13 @@ This function is meant to be called by `after-change-functions'."
409409
(goto-char beg)
410410
(beginning-of-line)
411411
(re-search-forward
412-
(org-with-limited-levels org-outline-regexp-bol) end t)))
412+
(org-with-limited-levels org-outline-regexp-bol)
413+
(save-excursion
414+
(goto-char end)
415+
;; Extend to headline if END is within its
416+
;; headline stars.
417+
(line-end-position))
418+
t)))
413419
(let ((end (save-excursion
414420
(goto-char end)
415421
(org-with-limited-levels (outline-next-heading))

0 commit comments

Comments
 (0)