New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ivy.el: Drop preselected candidate after input #1573
ivy.el: Drop preselected candidate after input #1573
Conversation
7be22b9
to
eb4bf6a
Compare
ivy.el
Outdated
;; If there was a preselected candidate, don't try to | ||
;; keep it selected even if the regexp still matches | ||
;; it. See issue #1563. See also `ivy--preselect-index', | ||
;; which this logic roughly mirrors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: please honour the sentence-end-double-space
setting in dir-locals-file
.
ivy.el
Outdated
(and (stringp (ivy-state-preselect ivy-last)) | ||
(string-match-p | ||
(ivy-state-preselect ivy-last) | ||
(ivy-state-current ivy-last))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: might be nice to bind ivy-state-preselect
and ivy-state-current
to reduce visual clutter (and avoid duplicate calls).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Seeing as there are other calls to these accessors in the function as well.)
eb4bf6a
to
1a44976
Compare
@basil-conto Good ideas! I made the relevant changes. |
ivy.el
Outdated
;; See issue #1563. See also `ivy--preselect-index', | ||
;; which this logic roughly mirrors. | ||
(not (let ((preselect (ivy-state-preselect ivy-last)) | ||
(current (ivy-state-current ivy-last))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Again, there are other parts of ivy--recompute-index
which could make use of these bindings.
1a44976
to
01c2dda
Compare
@basil-conto Fixed, thanks. |
@abo-abo Any comments? |
Merged, thanks. |
Suggested fix for #1563.