branch: externals/org
commit 5da9d6810bd49e6e3cad6deef4fac6e34d2d4ec0
Author: Ihor Radchenko <yanta...@gmail.com>
Commit: Ihor Radchenko <yanta...@gmail.com>

    org-element--cache-before-change: Fix handling sensitive edits at bol
    
    * lisp/org-element.el (org-element--cache-before-change): Fix
    optimisation when edits are involving element :end position.  Checking
    that END is at BOL fails when we insert at the beginning of a
    headline.
---
 lisp/org-element.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 90018afe2d..c5d67aca36 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -6575,7 +6575,9 @@ The function returns the new value of 
`org-element--cache-change-warning'."
        (beginning-of-line)
        (let ((bottom (save-excursion
                        (goto-char end)
-                       (if (bolp)
+                       (if (and (bolp)
+                                ;; When beg == end, still extent to eol.
+                                (> (point) beg))
                            ;; FIXME: Potential pitfall.
                            ;; We are appending to an element end.
                            ;; Unless the last inserted char is not

Reply via email to