[Top][All Lists]

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

[elpa] master 79de883 388/399: ivy.el (ivy--sort): Simplify

From: Oleh Krehel
Subject: [elpa] master 79de883 388/399: ivy.el (ivy--sort): Simplify
Date: Sat, 20 Jul 2019 14:58:05 -0400 (EDT)

branch: master
commit 79de883e63caaf41c2c2c2e7fdc3480ff85f5a38
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--sort): Simplify
    We should look at only `ivy-state-caller'. The direct calls to
    `ivy-read' already have it. And `ivy-completing-read` sets it up for
    `ivy-read' in the same way.
 ivy.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/ivy.el b/ivy.el
index a015275..d297cc7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3274,15 +3274,11 @@ The alist VAL is a sorting function with the signature 
 (defun ivy--sort (name candidates)
   "Re-sort candidates by NAME.
 All CANDIDATES are assumed to match NAME."
-  (let ((key (or (ivy-state-caller ivy-last)
-                 (when (functionp (ivy-state-collection ivy-last))
-                   (ivy-state-collection ivy-last))
-                 this-command))
-        fun)
+  (let (fun)
     (cond ((and ivy--flx-featurep
                 (eq ivy--regex-function 'ivy--regex-fuzzy))
            (ivy--flx-sort name candidates))
-          ((setq fun (ivy-alist-setting ivy-sort-matches-functions-alist key))
+          ((setq fun (ivy-alist-setting ivy-sort-matches-functions-alist))
            (funcall fun name candidates))

reply via email to

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