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

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

[elpa] externals/ivy-hydra 6b4f43a 111/395: ivy.el (ivy--update-minibuff


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 6b4f43a 111/395: ivy.el (ivy--update-minibuffer): Return string
Date: Thu, 25 Feb 2021 08:31:43 -0500 (EST)

branch: externals/ivy-hydra
commit 6b4f43a140ae16785e0c50a4f903562341844358
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy--update-minibuffer): Return string
---
 ivy.el | 89 +++++++++++++++++++++++++++++++++---------------------------------
 1 file changed, 45 insertions(+), 44 deletions(-)

diff --git a/ivy.el b/ivy.el
index cb0a0a1..54ef11e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3267,54 +3267,55 @@ Should be run via minibuffer `post-command-hook'."
     (let ((inhibit-field-text-motion nil))
       (constrain-to-field nil (point-max)))
     (ivy-set-text (ivy--input))
-    (ivy--update-minibuffer)))
+    (let ((new-minibuffer (ivy--update-minibuffer)))
+      (when new-minibuffer
+        (ivy--insert-minibuffer new-minibuffer)))
+    t))
 
 (defun ivy--update-minibuffer ()
-  (if (ivy-state-dynamic-collection ivy-last)
-      ;; while-no-input would cause annoying
-      ;; "Waiting for process to die...done" message interruptions
-      (let ((inhibit-message t)
-            coll in-progress)
-        (unless (equal ivy--old-text ivy-text)
-          (while-no-input
-            (setq coll (funcall (ivy-state-collection ivy-last) ivy-text))
-            (when (eq coll 0)
-              (setq coll nil)
+  (prog1
+      (if (ivy-state-dynamic-collection ivy-last)
+          ;; while-no-input would cause annoying
+          ;; "Waiting for process to die...done" message interruptions
+          (let ((inhibit-message t)
+                coll in-progress)
+            (unless (equal ivy--old-text ivy-text)
+              (while-no-input
+                (setq coll (funcall (ivy-state-collection ivy-last) ivy-text))
+                (when (eq coll 0)
+                  (setq coll nil)
+                  (setq ivy--old-re nil)
+                  (setq in-progress t))
+                (setq ivy--all-candidates (ivy--sort-maybe coll))))
+            (when (eq ivy--all-candidates 0)
+              (setq ivy--all-candidates nil)
               (setq ivy--old-re nil)
               (setq in-progress t))
-            (setq ivy--all-candidates (ivy--sort-maybe coll))
-            (setq ivy--old-text ivy-text)))
-        (when (eq ivy--all-candidates 0)
-          (setq ivy--all-candidates nil)
-          (setq ivy--old-re nil)
-          (setq in-progress t))
-        (when (or ivy--all-candidates
-                  (and (not (get-process " *counsel*"))
-                       (not in-progress)))
-          (ivy--set-index-dynamic-collection)
-          (ivy--insert-minibuffer
-           (ivy--format ivy--all-candidates))))
-    (cond (ivy--directory
-           (cond ((or (string= "~/" ivy-text)
-                      (and (string= "~" ivy-text)
-                           ivy-magic-tilde))
-                  (ivy--cd (ivy--magic-tilde-directory ivy--directory)))
-                 ((string-match "/\\'" ivy-text)
-                  (ivy--magic-file-slash))))
-          ((eq (ivy-state-collection ivy-last) #'internal-complete-buffer)
-           (when (or (and (string-match "\\` " ivy-text)
-                          (not (string-match "\\` " ivy--old-text)))
-                     (and (string-match "\\` " ivy--old-text)
-                          (not (string-match "\\` " ivy-text))))
-             (setq ivy--all-candidates
-                   (if (= (string-to-char ivy-text) ?\s)
-                       (ivy--buffer-list " ")
-                     (ivy--buffer-list "" ivy-use-virtual-buffers)))
-             (setq ivy--old-re nil))))
-    (ivy--insert-minibuffer
-     (with-current-buffer (ivy-state-buffer ivy-last)
-       (ivy--format
-        (ivy--filter ivy-text ivy--all-candidates))))
+            (when (or ivy--all-candidates
+                      (and (not (get-process " *counsel*"))
+                           (not in-progress)))
+              (ivy--set-index-dynamic-collection)
+              (ivy--format ivy--all-candidates)))
+        (cond (ivy--directory
+               (cond ((or (string= "~/" ivy-text)
+                          (and (string= "~" ivy-text)
+                               ivy-magic-tilde))
+                      (ivy--cd (ivy--magic-tilde-directory ivy--directory)))
+                     ((string-match "/\\'" ivy-text)
+                      (ivy--magic-file-slash))))
+              ((eq (ivy-state-collection ivy-last) #'internal-complete-buffer)
+               (when (or (and (string-match "\\` " ivy-text)
+                              (not (string-match "\\` " ivy--old-text)))
+                         (and (string-match "\\` " ivy--old-text)
+                              (not (string-match "\\` " ivy-text))))
+                 (setq ivy--all-candidates
+                       (if (= (string-to-char ivy-text) ?\s)
+                           (ivy--buffer-list " ")
+                         (ivy--buffer-list "" ivy-use-virtual-buffers)))
+                 (setq ivy--old-re nil))))
+        (with-current-buffer (ivy-state-buffer ivy-last)
+          (ivy--format
+           (ivy--filter ivy-text ivy--all-candidates))))
     (setq ivy--old-text ivy-text)))
 
 (defun ivy-display-function-fallback (str)



reply via email to

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