branch: externals/ivy-hydra
commit ace24753597403d038f1d5d093efa62192cac5c7
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    counsel.el (counsel--sync-sentinel-on-exit): Fix regression
    
    Commit cfb395ef07a515e1e805547c29046dc24464f395 caused a regression in
    `counsel-grep', where `ivy-index-functions-alist' was not honored.
    
    Re #2477
---
 counsel.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/counsel.el b/counsel.el
index 4e33028..9121aa0 100644
--- a/counsel.el
+++ b/counsel.el
@@ -223,11 +223,14 @@ respectively."
                   (ivy-set-index 0)
                 (ivy--recompute-index re ivy--all-candidates))
             (ivy-set-index
-             (ivy--preselect-index
-              (if (> (length re) 0)
-                  cur
-                (ivy-state-preselect ivy-last))
-              ivy--all-candidates))))
+             (let ((func (ivy-alist-setting ivy-index-functions-alist)))
+               (if func
+                   (funcall func re ivy--all-candidates)
+                 (ivy--preselect-index
+                  (if (> (length re) 0)
+                      cur
+                    (ivy-state-preselect ivy-last))
+                  ivy--all-candidates))))))
         (setq ivy--old-cands ivy--all-candidates)
         (if ivy--all-candidates
             (ivy--exhibit)

Reply via email to