There are times when you know that the candidate you want is near the end of the list which you could reach with a "Ctrl-end", but it will be great to have an option to just use the up arrow to go past the prompt and down to the end of the list.
Does M-> work?
Wrapping around would have to handle edge cases like if the prompt is selectable. As a user you might come into situations where you want to select the prompt and then it wraps around (or vice versa) which would be confusing/annoying.
Does
M->work?
Yes, that's perfect. Didn't realise that would work as usual. Thanks!
Wrapping around would have to handle edge cases like if the prompt is selectable.
Wrap only if already in the prompt and always wrap when going down at the bottom. It would be nice to reuse the same keys for this.
You can't always select the prompt so sometimes you would need to wrap before it is selected, which would lead to situations where the intention was to select the prompt but then it wraps around. I would prefer not to allow such behavior and instead recommend to jump to the first/last candidate using M-< and M->.
You can't always select the prompt so sometimes you would need to wrap before it is selected, which would lead to situations where the intention was to select the prompt but then it wraps around
That's what my response was addressing. It's not a complicated edge case. If the prompt is selectable, wrap around only after selecting the prompt. This is how ivy handles it, and my preference would be to have it as an option. I don't mind implementing it just in my own config if it's possible though. I'll look into it. Is it easy to get the current candidate #, the total candidates, and whether the prompt is selectable?
It isn't complicated but it seems to be a bit confusing to me UI wise, you can use something like the following:
(defun selectrum-next-candidate (&optional arg)
(interactive "p")
(when selectrum--current-candidate-index
(let ((selectable-prompt
(not (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)))))))
(index (+ selectrum--current-candidate-index (or arg 1)))
(max (1- (length selectrum--refined-candidates))))
(setq selectrum--current-candidate-index
(cond ((< index (if selectable-prompt -1 0))
max)
((> index max)
(if selectable-prompt -1 0))
(t
index))))))
Yeah, it's just that as a user, it seems like there is no way to tell whether or not the prompt will be selectable in any given command, so it would be hard to predict whether pressing <up> would lead to wraparound. But, of course, nothing wrong with implementing the command manually.