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

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

[elpa] externals/org-remark e5de684b67 33/67: fix: adjust location of hi


From: ELPA Syncer
Subject: [elpa] externals/org-remark e5de684b67 33/67: fix: adjust location of highlight
Date: Sat, 22 Jul 2023 06:59:02 -0400 (EDT)

branch: externals/org-remark
commit e5de684b67c60f65cde146015ea6d7c19fd49962
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    fix: adjust location of highlight
    
    Before this fix, the condition was only the existence of the
    "orginal-text" property. The check has been added to check if it is
    different to the current text.
---
 org-remark.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/org-remark.el b/org-remark.el
index 70f662af49..0d617ce971 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
 ;; URL: https://github.com/nobiot/org-remark
 ;; Version: 1.1.0
 ;; Created: 22 December 2020
-;; Last modified: 24 June 2023
+;; Last modified: 25 June 2023
 ;; Package-Requires: ((emacs "27.1") (org "9.4"))
 ;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
 
@@ -1466,8 +1466,14 @@ Meant to be set to 
`org-remark-highlights-after-load-hook' by
 mode-specific extensions."
   (dolist (ov overlays)
     (let ((highlight-text (overlay-get ov '*org-remark-original-text)))
-      (when highlight-text (org-remark-highlight-adjust-position-after-load
-                            ov highlight-text)))))
+      ;; original text exists AND
+      ;; it is different to the current
+      (when (and highlight-text
+                 (not (string= highlight-text
+                               (buffer-substring-no-properties
+                                (overlay-start ov) (overlay-end ov)))))
+        (org-remark-highlight-adjust-position-after-load
+         ov highlight-text)))))
 
 
 ;;;;; Other utilities



reply via email to

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