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

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

[elpa] externals/ivy-hydra 4235010 387/395: Re-revert last change to ivy


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 4235010 387/395: Re-revert last change to ivy-update-candidates
Date: Thu, 25 Feb 2021 08:32:44 -0500 (EST)

branch: externals/ivy-hydra
commit 4235010d2aaba907c7dceb48f09e5edfde1058c0
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Re-revert last change to ivy-update-candidates
    
    This mostly reverts commit 764b978759e68cd3bd42eb69ed4698e2948c7d4e
    "Revert last change to ivy-update-candidates", which in turn
    reverted commit 71c59aecf669142ebe264fac8ff7b440c0c71712
    "ivy.el (ivy--format-minibuffer-line): Check for annotation-function
    in one more place".
    
    But this commit should fix the original one for dynamic collections.
    
    * ivy.el (ivy--minibuffer-metadata): Reinstate.
    (ivy-update-candidates): Don't set ivy--minibuffer-metadata for
    dynamic collections.  Suggested by by Nikita Bloshchanevich
    <nikblos@outlook.com>.
    (ivy--format-minibuffer-line): Check for annotation-function in
    ivy--minibuffer-metadata again.
    
    Re: #2780.
    Closes #2783.
---
 ivy.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/ivy.el b/ivy.el
index 2c670e6..4bfc102 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3286,10 +3286,16 @@ The function was added in Emacs 26.1.")
           "~"
         home)))))
 
+(defvar ivy--minibuffer-metadata nil)
+
 (defun ivy-update-candidates (cands)
-  (ivy--insert-minibuffer
-   (ivy--format
-    (setq ivy--all-candidates cands))))
+  (let ((ivy--minibuffer-metadata
+         (unless (ivy-state-dynamic-collection ivy-last)
+           (completion-metadata "" minibuffer-completion-table
+                                minibuffer-completion-predicate))))
+    (ivy--insert-minibuffer
+     (ivy--format
+      (setq ivy--all-candidates cands)))))
 
 (defun ivy--exhibit ()
   "Insert Ivy completions display.
@@ -4032,7 +4038,8 @@ in this case."
                     (funcall ivy--highlight-function str))
                 str))
          (olen (length str))
-         (annot (plist-get completion-extra-properties :annotation-function)))
+         (annot (or (completion-metadata-get ivy--minibuffer-metadata 
'annotation-function)
+                    (plist-get completion-extra-properties 
:annotation-function))))
     (add-text-properties
      0 olen
      '(mouse-face



reply via email to

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