emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 064afa0c01 11/12: org-indent: Fix edge case when ed


From: ELPA Syncer
Subject: [elpa] externals/org 064afa0c01 11/12: org-indent: Fix edge case when edited region ends at headline leading stars
Date: Sun, 17 Jul 2022 04:57:51 -0400 (EDT)

branch: externals/org
commit 064afa0c0165af1f1e830d4e5b4ce4957beb949d
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    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
---
 lisp/org-indent.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org-indent.el b/lisp/org-indent.el
index 08b4aacb28..01a53f7534 100644
--- a/lisp/org-indent.el
+++ b/lisp/org-indent.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]