branch: externals/vertico commit 788002fe7d537b31f1e0be53b0f85196cf296a4f Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
vertico-flat/quick: Minor cleanup --- extensions/vertico-flat.el | 15 +++++++-------- extensions/vertico-quick.el | 9 ++++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el index 8e5a473..c6366df 100644 --- a/extensions/vertico-flat.el +++ b/extensions/vertico-flat.el @@ -35,9 +35,10 @@ (defcustom vertico-flat-separator (list (propertize "{" 'face 'minibuffer-prompt) (propertize " | " 'face 'minibuffer-prompt) - (propertize "}" 'face 'minibuffer-prompt)) + (propertize "}" 'face 'minibuffer-prompt) + (propertize "…" 'face 'minibuffer-prompt)) "Separator strings." - :type '(list string string string) + :type '(list string string string string) :group 'vertico) (defun vertico-flat--display (candidates) @@ -57,13 +58,11 @@ (let* ((index vertico--index) (count vertico-count) (candidates (nthcdr vertico--index vertico--candidates)) - (width (- (window-width) + (width (- (window-width) 4 (length (car vertico-flat-separator)) (length (caddr vertico-flat-separator)) - (point-max) - (if vertico--count-ov - (length (overlay-get vertico--count-ov 'before-string)) - 0))) + (length (cadddr vertico-flat-separator)) + (car (posn-col-row (posn-at-point (1- (point-max))))))) (result)) (while (and candidates (> width 0) (> count 0)) (let ((cand (car candidates))) @@ -80,7 +79,7 @@ (push cand result)) (pop candidates))) (unless (or (= vertico--total 0) (= index vertico--total)) - (push "…" result)) + (push (cadddr vertico-flat-separator) result)) (nreverse result))) ;;;###autoload diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el index 7b11f5c..22ba3d0 100644 --- a/extensions/vertico-quick.el +++ b/extensions/vertico-quick.el @@ -94,11 +94,10 @@ (defun vertico-quick-jump () "Jump to candidate using quick keys." (interactive) - (cl-letf* ((vertico-quick--list nil) - (key nil) - (orig-format (symbol-function #'vertico--format-candidate)) - ((symbol-function #'vertico--format-candidate) - (apply-partially #'vertico-quick--format-candidate orig-format))) + (cl-letf ((vertico-quick--list nil) (key nil) + ((symbol-function #'vertico--format-candidate) + (apply-partially #'vertico-quick--format-candidate + (symbol-function #'vertico--format-candidate)))) (vertico--exhibit) (setq key (read-key)) (when (seq-position vertico-quick2 key)