branch: elpa/magit
commit 78d753e4349c18af5b989619b3a2cd1d1468e5b8
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-builtin-completing-read: Prevent sorting differently
    
    Suggested-by: Daniel Mendler <m...@daniel-mendler.de>
      https://github.com/magit/magit/commit/8a3674b4272cb
---
 lisp/magit-base.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index 0bd7a444d9..a2e8d07957 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -642,9 +642,13 @@ acts similarly to `completing-read', except for the 
following:
   (unless (or (bound-and-true-p helm-mode)
               (bound-and-true-p ivy-mode))
     (setq choices (magit--completion-table choices)))
-  (let ((ivy-sort-functions-alist nil)
-        (vertico-sort-function nil))
-    (completing-read prompt choices
+  (let ((ivy-sort-functions-alist nil))
+    (completing-read prompt
+                     (lambda (str pred action)
+                       (if (eq action 'metadata)
+                           '(metadata (display-sort-function . identity)
+                                      (cycle-sort-function . identity))
+                         (complete-with-action action choices str pred)))
                      predicate require-match
                      initial-input hist def)))
 

Reply via email to