selectrum: add experimental vertico flag

This commit is contained in:
Itai Y. Efrat 2021-06-30 17:36:08 +03:00
parent 78955d8a64
commit d3eff82b9d
7 changed files with 90 additions and 20 deletions

View file

@ -123,12 +123,24 @@ Supports exporting consult-grep to wgrep, file to wdeired, and consult-location
(defun +selectrum/next-candidate-preview ()
"Move to next candidate and preivew it"
(interactive)
(selectrum-next-candidate)
(if (featurep! :completion selectrum +vertico)
(vertico-next)
(selectrum-next-candidate))
(+selectrum/embark-preview))
;;;###autoload
(defun +selectrum/previous-candidate-preview ()
"Move to previous candidate and preview it"
(interactive)
(selectrum-previous-candidate)
(if (featurep! :completion selectrum +vertico)
(vertico-previous)
(selectrum-previous-candidate))
(+selectrum/embark-preview))
;;;###autoload
(defun +selectrum/repeat ()
"Repeat the last selectrum/vertico command."
(interactive)
(if (featurep! :completion selectrum +vertico)
(user-error "The vertico flag doesn't support repeating commands (yet)")
(selectrum-repeat)))