[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico c734b0f 02/11: Minor simplification and docstri
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/vertico c734b0f 02/11: Minor simplification and docstring updates |
Date: |
Thu, 8 Apr 2021 07:11:15 -0400 (EDT) |
branch: externals/vertico
commit c734b0f72c999a6a6397333004bfa808caf8ded6
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Minor simplification and docstring updates
---
vertico.el | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/vertico.el b/vertico.el
index 8badf84..e392b14 100644
--- a/vertico.el
+++ b/vertico.el
@@ -296,22 +296,20 @@
"Format current candidates with INPUT string and METADATA."
(let* ((index (min (max 0 (- vertico--index (/ vertico-count 2)))
(max 0 (- vertico--total vertico-count))))
- (candidates (seq-subseq vertico--candidates index
- (min (+ index vertico-count) vertico--total)))
- (ann-candidates
- (vertico--annotate
- metadata
- (vertico--highlight
- (substring input
- (car (completion-boundaries input
minibuffer-completion-table
-
minibuffer-completion-predicate "")))
- metadata
- candidates)))
+ (candidates
+ (thread-last (seq-subseq vertico--candidates index
+ (min (+ index vertico-count)
vertico--total))
+ (vertico--highlight
+ (substring input
+ (car (completion-boundaries input
minibuffer-completion-table
+
minibuffer-completion-predicate "")))
+ metadata)
+ (vertico--annotate metadata)))
(max-width (- (* 2 (window-width)) 5))
(title)
(chunks (list #(" " 0 1 (cursor t))))
(group (completion-metadata-get metadata 'x-group-function)))
- (dolist (ann-cand ann-candidates)
+ (dolist (ann-cand candidates)
(push (if (= index (1+ vertico--index))
#("\n" 0 1 (face vertico-current))
"\n")
@@ -344,12 +342,12 @@
(apply #'concat (nreverse chunks))))
(defun vertico--display-candidates (str)
- "Update candidates overlay with STR."
+ "Update candidates overlay `vertico--candidates-ov' with STR."
(move-overlay vertico--candidates-ov (point-max) (point-max))
(overlay-put vertico--candidates-ov 'after-string str))
(defun vertico--display-count ()
- "Update count overlay."
+ "Update count overlay `vertico--count-ov'."
(when vertico-count-format
(move-overlay vertico--count-ov (point-min) (point-min))
(overlay-put vertico--count-ov 'before-string
@@ -362,7 +360,7 @@
vertico--total)))))
(defun vertico--tidy-shadowed-file ()
- "Tidy shadowed file name."
+ "Tidy shadowed file name, see `rfn-eshadow-overlay'."
(when (and minibuffer-completing-file-name
(eq this-command #'self-insert-command)
(bound-and-true-p rfn-eshadow-overlay)
@@ -497,17 +495,17 @@
(advice-remove #'completing-read-multiple #'vertico--advice)))
(defun vertico--consult-candidate ()
- "Return current candidate."
+ "Return current candidate for Consult preview."
(and vertico--input (vertico--candidate)))
(defun vertico--consult-refresh ()
- "Refresh completion UI."
+ "Refresh completion UI, used by Consult async/narrowing."
(when vertico--input
(setq vertico--input t)
(vertico--exhibit)))
(defun vertico--embark-target ()
- "Return embark target."
+ "Return Embark target."
(and vertico--input
(cons (completion-metadata-get (completion--field-metadata
(minibuffer-prompt-end))
@@ -515,13 +513,12 @@
(vertico--candidate))))
(defun vertico--embark-candidates ()
- "Return embark candidates."
+ "Return Embark candidates."
(and vertico--input
(cons (completion-metadata-get (completion--field-metadata
(minibuffer-prompt-end))
'category)
- ;; full candidates?
- vertico--candidates)))
+ vertico--candidates))) ;; TODO: full candidates?
(with-eval-after-load 'consult
(add-hook 'consult--completion-candidate-hook #'vertico--consult-candidate)
- [elpa] externals/vertico updated (1a9b1b2 -> 82ed224), Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico d65eeac 04/11: vertico--recompute-candidates: Move exact input and default to front, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico ee77886 01/11: Expand README, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico c734b0f 02/11: Minor simplification and docstring updates,
Protesilaos Stavrou <=
- [elpa] externals/vertico d9bb816 09/11: README: Mention a few more useful configurations, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 403e154 05/11: Fix #2 - Screenshot background, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico edf6a06 08/11: Do not always overwrite resize-mini-windows (See #5), Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico bf76000 06/11: Rename vertico--pred to vertico--sort-predicate, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 1522d9a 07/11: Extract vertico--file-predicate, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 953ff1e 10/11: README: Document keymap, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 82ed224 11/11: Package: Remove license header in order to fix the ELPA linter, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico a68f4cf 03/11: vertico--format-candidates: Only add space for point if eobp, Protesilaos Stavrou, 2021/04/08