Closed alexei-28 closed 2 years ago
No, but vertico supports this feature through vertico-cycle
if you're interested in it.
No, but vertico supports this feature through
vertico-cycle
if you're interested in it.
I was on vertico but I prefer selectrum.
Just wondering, what do you prefer about it?
Just wondering, what do you prefer about it?
Looks like there's no built-in way, but you could override the selectrum-next-candidate
function to wrap instead of clamping.
Feels like a bit of a hack, but worked fine when I tested it locally.
(defun selectrum--wrap (x lower upper)
(cond ((< x lower) upper)
((> x upper) lower)
('t x)))
(defun selectrum-next-candidate (&optional arg)
"Move selection ARG candidates down, stopping at the end."
(interactive "p")
(when selectrum--current-candidate-index
(setq selectrum--current-candidate-index
(selectrum--wrap
(+ selectrum--current-candidate-index (or arg 1))
(if (and (selectrum--match-strictly-required-p)
(cond (minibuffer-completing-file-name
(not (selectrum--at-existing-prompt-path-p)))
(t
(not (string-empty-p selectrum--virtual-input)))))
0
-1)
(1- (length selectrum--refined-candidates))))))
Please test whether PR #588 works for you.
Linux Mint 20.2
Emacs 27.2
Install package spectrum.
Is it possible to enable cycling for
selectrum-next-candidate' and
selectrum-previous-candidate'? E.g when press arrow down on last candidate then start from begining on the list of candidate?