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

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

[elpa] externals/vertico 9905c28 03/10: Ensure that completion cycling o


From: Protesilaos Stavrou
Subject: [elpa] externals/vertico 9905c28 03/10: Ensure that completion cycling of default completion works
Date: Fri, 9 Apr 2021 10:48:29 -0400 (EDT)

branch: externals/vertico
commit 9905c28d951efb9d1f0e49db7ff3f52dd68ca3e9
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Ensure that completion cycling of default completion works
---
 vertico.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/vertico.el b/vertico.el
index 03a2831..e2c48d4 100644
--- a/vertico.el
+++ b/vertico.el
@@ -396,6 +396,13 @@
                  (eq ?/ (char-before (- (point) 2)))))
     (delete-region (overlay-start rfn-eshadow-overlay) (overlay-end 
rfn-eshadow-overlay))))
 
+(defun vertico--prompt-selection ()
+  "Highlight the prompt if selected."
+  (let ((inhibit-modification-hooks t))
+    (if (or (>= vertico--index 0) (vertico--require-match))
+        (remove-text-properties (minibuffer-prompt-end) (point-max) '(face 
nil))
+      (add-text-properties (minibuffer-prompt-end) (point-max) '(face 
vertico-current)))))
+
 (defun vertico--exhibit ()
   "Exhibit completion UI."
   (vertico--tidy-shadowed-file)
@@ -405,9 +412,7 @@
       (vertico--update-candidates input metadata))
     (vertico--display-candidates (vertico--format-candidates input metadata))
     (vertico--display-count)
-    (if (or (>= vertico--index 0) (vertico--require-match))
-        (remove-text-properties (minibuffer-prompt-end) (point-max) '(face 
nil))
-      (add-text-properties (minibuffer-prompt-end) (point-max) '(face 
vertico-current)))))
+    (vertico--prompt-selection)))
 
 (defun vertico--require-match ()
   "Return t if match is required."



reply via email to

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