[Top][All Lists]

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

[elpa] master 888b417 350/399: ivy.el (ivy--recompute-index-inhibit): Ad

From: Oleh Krehel
Subject: [elpa] master 888b417 350/399: ivy.el (ivy--recompute-index-inhibit): Add
Date: Sat, 20 Jul 2019 14:57:55 -0400 (EDT)

branch: master
commit 888b417700c3b7cef3e08bc378c60a68fa87d381
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--recompute-index-inhibit): Add
 ivy.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index 7213945..69d0e4d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3341,6 +3341,9 @@ before substring matches."
 When the amount of matching candidates exceeds this limit, then
 no sorting is done.")
+(defvar ivy--recompute-index-inhibit nil
+  "When non-nil, `ivy--recompute-index' is a no-op.")
 (defun ivy--recompute-index (name re-str cands)
   "Recompute index of selected candidate matching NAME.
 RE-STR is the regexp, CANDS are the current candidates."
@@ -3351,7 +3354,8 @@ RE-STR is the regexp, CANDS are the current candidates."
         (preselect (ivy-state-preselect ivy-last))
         (current (ivy-state-current ivy-last))
         (empty (string= name "")))
-    (unless (memq this-command '(ivy-resume ivy-partial-or-done))
+    (unless (or (memq this-command '(ivy-resume ivy-partial-or-done))
+                ivy--recompute-index-inhibit)
        (if (or (string= name "")
                (and (> (length cands) 10000) (eq func 
@@ -4055,7 +4059,8 @@ BUFFER may be a string or nil."
   (setf (ivy-state-preselect ivy-last) ivy--index)
   (setq ivy--old-re nil)
   (setq ivy--all-candidates (delete (ivy-state-current ivy-last) 
-  (ivy--exhibit))
+  (let ((ivy--recompute-index-inhibit t))
+    (ivy--exhibit)))
 (defun ivy--kill-buffer-action (buffer)
   "Kill BUFFER."

reply via email to

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