-
-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Description
After 126158d, the first match should be selected after the input has changed with the exception of swiper. It works in the case I constructed in #231 but not always. Here's a test case which currently fails:
(should (equal
(ivy-with '(ivy-read "pattern: " '("aba"
"baa"
"abc"))
"a b <down> <backspace> C-m")
"aba")) ;; What's actually selected now is baa
Here I'd expect the first item "aba" to be selected because the first matching element should be selected after changes to the input. What's actually selected is "baa" which is neither the first match nor the last match so completely implausible. So that's a bug but I also have two other points.
- I agree with @PythonNut's comment in Ivy: default input should not stick after typing #231 in that one might want to customize that behavior on a per-command basis. Right now
swiperandcounsel-git-grepare exceptions identified by the last state having the unwind functionswiper--cleanup, but testing for some specific unwind function seems to be the wrong thing to do. So I suggest to introduce some defcustomivy-select-first-after-change-list(I'm not convinced of the name) and then changing the test to(memq this-command ivy-select-first-after-change-list). - I think that once a user switched candidates explicitly with
C-n/C-p/<up>/<down>, the selection of the first candidate after changes should be disabled, i.e., the selection should stick to the last one in case it is still valid. If that were implemented, the test case above should expect "abc" instead of "aba".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels