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

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

[nongnu] elpa/annotate e933d84692 214/372: - fixed removing of annotatio


From: ELPA Syncer
Subject: [nongnu] elpa/annotate e933d84692 214/372: - fixed removing of annotation in 'annotate-before-change-fn'
Date: Fri, 4 Feb 2022 16:59:01 -0500 (EST)

branch: elpa/annotate
commit e933d8469234df79ed248429396a899a8f354d5c
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>

    - fixed removing of annotation in 'annotate-before-change-fn'
    
      sometimes  when the  annotated text  is changed  we could  remove an
      overlay  that is  part of  an annotation  chain. This  is ok  but if
      happens to delete  the last element of a chain  we should ensure the
      the preceding overlay takes is place, if such overlay exists.
---
 annotate.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/annotate.el b/annotate.el
index 73180a9e5d..8434c0a16a 100644
--- a/annotate.el
+++ b/annotate.el
@@ -325,7 +325,17 @@ modified (for example a newline is inserted)."
            (move-overlay overlay (overlay-start overlay) a)
            ;; delete overlay if there is no more annotated text
            (when (annotate-annotated-text-empty-p overlay)
-             (delete-overlay overlay))))))))
+             ;; we  are  deleting  the  last element  of  a  chain  (a
+             ;; stopper)...
+             (when (annotate-chain-last-p overlay)
+               ;; move 'stopper' to the previous chain element
+               (let ((annot-before (annotate-previous-annotation-ends 
(overlay-start overlay))))
+                 ;; ...if such element exists
+                 (when annot-before
+                   (annotate-annotation-chain-position annot-before
+                                                       
annotate-prop-chain-pos-marker-last))))
+             (delete-overlay overlay)
+             (font-lock-fontify-buffer))))))))
 
 (defun annotate-info-select-fn ()
   "The function to be called when an info buffer is updated"



reply via email to

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