emacs-diffs
[Top][All Lists]
Advanced

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

feature/icomplete-vertical 555efd9: Icomplete-vertical fix first candida


From: Jimmy Aguilar Mena
Subject: feature/icomplete-vertical 555efd9: Icomplete-vertical fix first candidate and icomplete-hide-common-prefix.
Date: Mon, 7 Sep 2020 13:28:58 -0400 (EDT)

branch: feature/icomplete-vertical
commit 555efd91c9815849f241afbf97ea32ed8c577c1f
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>

    Icomplete-vertical fix first candidate and icomplete-hide-common-prefix.
    
    * lisp/icomplete.el (icomplete--vertical-prospects) : process
    differently the fist candidate and not remove prefixes for the rest.
---
 lisp/icomplete.el | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 926cf6a..62a46fa 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -502,11 +502,18 @@ Conditions are:
                                   max-mini-window-height)
                                  (t 1)))
         limit prospects comp)
+
+    ;; First candidate
+    (when (and prefix-len
+               icomplete-hide-common-prefix)
+      (push (substring (car comps) prefix-len) prospects)
+
+      (setq comps (cdr comps)
+            prospects-rows (1+ prospects-rows)))
+
+    ;; The others
     (while (and comps (not limit))
-      (setq comp (if (and icomplete-hide-common-prefix
-                          prefix-len)
-                     (substring (car comps) prefix-len)
-                   (car comps))
+      (setq comp (car comps)
             comps (cdr comps))
 
       (setq prospects-rows (1+ prospects-rows))
@@ -515,7 +522,8 @@ Conditions are:
          (push comp prospects)
         (push icomplete-ellipsis prospects)
        (setq limit t)))
-    (nreverse prospects)))
+    (nreverse prospects)
+    ))
 
 
 (defun icomplete--vertical-mode-setup ()



reply via email to

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