[Top][All Lists]

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

[elpa] master 3416142 128/399: counsel.el (counsel--async-sentinel): Fix

From: Oleh Krehel
Subject: [elpa] master 3416142 128/399: counsel.el (counsel--async-sentinel): Fix index jumping randomly
Date: Sat, 20 Jul 2019 14:57:08 -0400 (EDT)

branch: master
commit 34161427f438c4c8fe9f118ff2361d5c6a08a488
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel--async-sentinel): Fix index jumping randomly
    Previously, if a function, e.g. `counsel-rg', had
    `ivy-recompute-index-zero' associated, the index would not always
    reset to 0. This should be fixed now.
    TODO: simplify the logic here.
 counsel.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 8abc5f1..43200db 100644
--- a/counsel.el
+++ b/counsel.el
@@ -216,7 +216,9 @@ respectively."
                   (time-to-seconds (time-since counsel--async-start))))
           (let ((re (ivy-re-to-str (funcall ivy--regex-function ivy-text))))
             (if ivy--old-cands
-                (ivy--recompute-index ivy-text re ivy--all-candidates)
+                (if (eq (ivy-alist-setting ivy-index-functions-alist) 
+                    (ivy-set-index 0)
+                  (ivy--recompute-index ivy-text re ivy--all-candidates))
               (unless (ivy-set-index
                         (ivy-state-preselect ivy-last)

reply via email to

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