Mark current vertico candicate with fringe indicator
The default highlighting is nice, but sometimes be hard to see due to text faces (e.g with `consult-org-heading`).
This commit is contained in:
parent
613044b954
commit
145f99d5ae
19
init.el
19
init.el
@ -2421,7 +2421,24 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
:commands (vertico-mode)
|
:commands (vertico-mode)
|
||||||
:autoload (vertico-sort-history-alpha
|
:autoload (vertico-sort-history-alpha
|
||||||
vertico-sort-alpha)
|
vertico-sort-alpha)
|
||||||
:init (setq vertico-sort-function #'vertico-sort-history-alpha))
|
:init (setq vertico-sort-function #'vertico-sort-history-alpha)
|
||||||
|
:config (progn
|
||||||
|
|
||||||
|
;; Mark current candiate with pointer, because highlighting might sometimes be hard to
|
||||||
|
;; see; cf. https://github.com/minad/vertico/wiki#prefix-current-candidate-with-arrow.
|
||||||
|
(cl-defmethod vertico--format-candidate :around
|
||||||
|
(cand prefix suffix index start &context ((not (bound-and-true-p vertico-flat-mode))
|
||||||
|
(eql t)))
|
||||||
|
(setq cand (cl-call-next-method cand prefix suffix index start))
|
||||||
|
(if (bound-and-true-p vertico-grid-mode)
|
||||||
|
(if (= vertico--index index)
|
||||||
|
(concat #("▶" 0 1 (face vertico-current)) cand)
|
||||||
|
(concat #("_" 0 1 (display " ")) cand))
|
||||||
|
(if (= vertico--index index)
|
||||||
|
(concat
|
||||||
|
#(" " 0 1 (display (left-fringe right-triangle vertico-current)))
|
||||||
|
cand)
|
||||||
|
cand)))))
|
||||||
|
|
||||||
(use-package orderless
|
(use-package orderless
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user