[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 7a23f3f: vertico-quick/vertico-indexed: Add err
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vertico 7a23f3f: vertico-quick/vertico-indexed: Add error check |
Date: |
Mon, 12 Jul 2021 22:57:16 -0400 (EDT) |
branch: externals/vertico
commit 7a23f3f207fb5fc8d65a39eac7785c9d71e963df
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
vertico-quick/vertico-indexed: Add error check
---
extensions/vertico-indexed.el | 13 +++++++------
extensions/vertico-quick.el | 30 ++++++++++++++++--------------
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/extensions/vertico-indexed.el b/extensions/vertico-indexed.el
index 25ffe37..6bc6d96 100644
--- a/extensions/vertico-indexed.el
+++ b/extensions/vertico-indexed.el
@@ -55,13 +55,14 @@
(defun vertico-indexed--handle-prefix (orig &optional _)
"Handle prefix argument before calling ORIG function."
- (let ((vertico--index (if current-prefix-arg
- (+ vertico-indexed--min (prefix-numeric-value
current-prefix-arg))
- vertico--index)))
+ (if current-prefix-arg
+ (let ((vertico--index (+ vertico-indexed--min (prefix-numeric-value
current-prefix-arg))))
(if (or (< vertico--index vertico-indexed--min)
- (> vertico--index vertico-indexed--max))
- (message "Index out of range")
- (funcall orig))))
+ (> vertico--index vertico-indexed--max)
+ (= vertico--total 0))
+ (minibuffer-message "Out of range")
+ (funcall orig))
+ (funcall orig))))
;;;###autoload
(define-minor-mode vertico-indexed-mode
diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index dd3033f..9fc061f 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -101,20 +101,22 @@
(defun vertico-quick-jump ()
"Jump to candidate using quick keys."
(interactive)
- (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 (and (alist-get key vertico-quick--list)
- (seq-position vertico-quick2 key))
- (let ((vertico-quick--first key)
- (vertico-quick--list))
- (vertico--exhibit))
- (setq key (+ key (ash (read-key) 16))))
- (when-let (idx (alist-get key vertico-quick--list))
- (setq vertico--index idx))))
+ (if (= vertico--total 0)
+ (and (minibuffer-message "No match") nil)
+ (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 (and (alist-get key vertico-quick--list)
+ (seq-position vertico-quick2 key))
+ (let ((vertico-quick--first key)
+ (vertico-quick--list))
+ (vertico--exhibit))
+ (setq key (+ key (ash (read-key) 16))))
+ (when-let (idx (alist-get key vertico-quick--list))
+ (setq vertico--index idx)))))
;;;###autoload
(defun vertico-quick-exit ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/vertico 7a23f3f: vertico-quick/vertico-indexed: Add error check,
ELPA Syncer <=