[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/embark 866d8efa88 06/30: Visual feedback on selection i
From: |
ELPA Syncer |
Subject: |
[elpa] externals/embark 866d8efa88 06/30: Visual feedback on selection in Vertico |
Date: |
Thu, 20 Apr 2023 10:58:21 -0400 (EDT) |
branch: externals/embark
commit 866d8efa888ad1bf7e72bd7ff25f34110098ac8b
Author: Omar Antolín Camarena <omar.antolin@gmail.com>
Commit: Omar Antolín Camarena <omar.antolin@gmail.com>
Visual feedback on selection in Vertico
---
embark.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/embark.el b/embark.el
index ac30ffab6b..8c194144b4 100644
--- a/embark.el
+++ b/embark.el
@@ -3275,8 +3275,10 @@ You can act on all selected targets at once with
`embark-act-all'.")
(declare-function vertico--candidate "ext:vertico")
(declare-function vertico--update "ext:vertico")
+(declare-function vertico--remove-face "ext:vertico")
(defvar vertico--input)
(defvar vertico--candidates)
+(defvar vertico--base)
(defun embark--vertico-selected ()
"Target the currently selected item in Vertico.
@@ -3306,13 +3308,22 @@ Return the category metadatum as the type of the
candidates."
(cons '(vertico-current . embark-target) fr)
fr))))))
+(defun embark--vertico-highlight-selected (cand _prefix _suffix _index _start)
+ "Highlight Vertico itmes in the current Embark selection.
+This is meant to be used as advice for `vertico--format-candidate'."
+ (if (member (concat vertico--base cand) embark--selection)
+ (add-face-text-property 0 (length cand) 'embark-selected nil cand)
+ (vertico--remove-face 0 (length cand) 'embark-selected cand)))
+
(with-eval-after-load 'vertico
(add-hook 'embark-indicators #'embark--vertico-indicator)
(add-hook 'embark-target-finders #'embark--vertico-selected)
(add-hook 'embark-candidate-collectors #'embark--vertico-candidates)
(setq embark-candidate-collectors
(cons 'embark-selected-candidates ; ensure highest priority
- (delq 'embark-selected-candidates embark-candidate-collectors))))
+ (delq 'embark-selected-candidates embark-candidate-collectors)))
+ (advice-add 'vertico--format-candidate
+ :before 'embark--vertico-highlight-selected))
;; ivy
- [elpa] externals/embark updated (846b3fd311 -> e7d891a8b2), ELPA Syncer, 2023/04/20
- [elpa] externals/embark 75aa8c25b0 02/30: Don't store bounds, recover from overlay, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 93ab10c48d 07/30: Delay computing :bounds until right before acting, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 99757457f7 11/30: Better key bindings for selecting targets, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 9d08b34d62 03/30: Collect selection in chronological order, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 4ab2f965f4 14/30: Fix old bug with target types in *Completions* buffer, ELPA Syncer, 2023/04/20
- [elpa] externals/embark c2721bef37 23/30: Simplify code for ensuring embark-selected-candidates has priority, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 866d8efa88 06/30: Visual feedback on selection in Vertico,
ELPA Syncer <=
- [elpa] externals/embark a8e56c44e0 05/30: Make sure embark-selected-candidates has highest priority, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 6362c369bf 04/30: Enable multiple selection in Embark Collect buffers, ELPA Syncer, 2023/04/20
- [elpa] externals/embark b7550f84d7 09/30: When deciding if a candidate is selected compare original targets, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 2a5edf3cb8 12/30: Document selection, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 729f944a3b 17/30: Avoid long line, ELPA Syncer, 2023/04/20
- [elpa] externals/embark 868d799753 28/30: Change other binding of whitespace-cleanup-region too, ELPA Syncer, 2023/04/20
- [elpa] externals/embark c9954e94f9 16/30: Revert "Do preemptive refinement of selection targets", ELPA Syncer, 2023/04/20
- [elpa] externals/embark edba98ce5c 22/30: Remove C-. C-u SPC in favor of C-. A SPC, ELPA Syncer, 2023/04/20
- [elpa] externals/embark cce4c3b86e 24/30: Allow candidate collectors to include bounds, ELPA Syncer, 2023/04/20
- [elpa] externals/embark ccb8b15edf 25/30: Document new selection functionality for collect buffers, ELPA Syncer, 2023/04/20