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

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

[nongnu] elpa/helm 7e0da38d59: Fix error when the score fn return a stri


From: ELPA Syncer
Subject: [nongnu] elpa/helm 7e0da38d59: Fix error when the score fn return a string (HFF)
Date: Sun, 3 Nov 2024 13:00:29 -0500 (EST)

branch: elpa/helm
commit 7e0da38d5942d48cb72748b05992eb398cffb97c
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix error when the score fn return a string (HFF)
    
    This happen with adb method.
---
 helm-files.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index 0fe850534a..793b70953e 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -4160,7 +4160,7 @@ returned prefixed with its icon or unchanged."
 (defun helm-ff-score-candidate-for-pattern (real disp pattern)
   (cond ((member real '("." "..")) 900000)
         ((and (string-match-p "\\`\\s-\\{2\\}" disp)
-               (string= real (substring-no-properties disp 2)))
+              (string= real (substring-no-properties disp 2)))
          ;; Incomplete filenames are prefixed with two spaces, the
          ;; first one beeing propertized with a 'display prop
          ;; i.e. "[+] foo".
@@ -4191,7 +4191,9 @@ Return candidates prefixed with basename of INPUT first."
                                         (puthash r1 (funcall score r1 d1) 
memo-src)))
                                (sc2 (or (gethash r2 memo-src)
                                         (puthash r2 (funcall score r2 d2) 
memo-src))))
-                          (cond ((= sc1 sc2)
+                          ;; The score fn may return a string (happens with 
"/adb:").
+                          (cond ((or (stringp sc1) (stringp sc2)))
+                                ((= sc1 sc2)
                                  (< (string-width r1)
                                     (string-width r2)))
                                 ((> sc1 sc2))))))))



reply via email to

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