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

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

[elpa] externals/avy 955c8dedd6 30/31: avy.el (avy--overlay): Avoid erro


From: ELPA Syncer
Subject: [elpa] externals/avy 955c8dedd6 30/31: avy.el (avy--overlay): Avoid error on empty string
Date: Mon, 13 Feb 2023 21:57:28 -0500 (EST)

branch: externals/avy
commit 955c8dedd68c74f3cf692c1249513f048518c4c9
Author: David J. Rosenbaum <djr7c4@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    avy.el (avy--overlay): Avoid error on empty string
    
    Fixes #351
    Fixes #352
---
 avy.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/avy.el b/avy.el
index 80f9a412c4..4c94a309a7 100644
--- a/avy.el
+++ b/avy.el
@@ -1019,10 +1019,11 @@ COMPOSE-FN is a lambda that concatenates the old string 
at BEG with STR."
              (os-line-prefix (get-text-property 0 'line-prefix old-str))
              (os-wrap-prefix (get-text-property 0 'wrap-prefix old-str))
              other-ol)
-        (when os-line-prefix
-          (add-text-properties 0 1 `(line-prefix ,os-line-prefix) str))
-        (when os-wrap-prefix
-          (add-text-properties 0 1 `(wrap-prefix ,os-wrap-prefix) str))
+        (unless (= (length str) 0)
+          (when os-line-prefix
+            (add-text-properties 0 1 `(line-prefix ,os-line-prefix) str))
+          (when os-wrap-prefix
+            (add-text-properties 0 1 `(wrap-prefix ,os-wrap-prefix) str)))
         (when (setq other-ol (cl-find-if
                               (lambda (o) (overlay-get o 'goto-address))
                               (overlays-at beg)))



reply via email to

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