Skip to content
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

completion ignores candidates other than the 1st directory while find-file #2199

Closed
flying-foozy opened this issue Aug 14, 2019 · 2 comments
Closed

Comments

@flying-foozy
Copy link

@flying-foozy flying-foozy commented Aug 14, 2019

Completion by TAB key while find-file does not work as expected in the case below.

  1. completion by TAB causes expansion
  2. there are some candidates, even after expansion
  3. the 1st candidate is directory

Then, the 1st candidate is automatically selected, even though there is at least one another candidate.
By default, ivy-sort-file-function-default is used while find-file, and it lists up directories before files. Therefore, this unexpected selection easily occurs.
For example, if there are directory "barfoo" and file "foobar" while find-file:

  • "f" (or "fo") + TAB causes selecting "barfoo", but
  • "foo" + TAB does not

On the other hand, "f" + TAB, "fo" + TAB, and "foo" + TAB cause same result ("foo" is completed, but any one is not yet selected) in cases below:

  • if both "barfoo" and "foobar" are file (exactly speaking, "if they are not directory or symlink to directory")
  • if sorting makes a file the 1st of candidates (e.g. file "barfoo" comes before directory "foobar", by using ivy-string< as sort function for read-file-name-internal)

AFAIK, both ivy-partial-or-done and ivy-partial cause same result.

Is this intentional behavior ? And if so, how can I avoid this automatic selection ?

My environment is:

  • ivy 0.12.0, installed via MELPA
  • Emacs 25.2.2 on Ubuntu 18.04.3

I can reproduce this behavior after evaluation lisp code below on emacs invoked with -Q.

(package-initialize)
(ivy-mode 1)
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Aug 21, 2019

Thanks, please test.

@flying-foozy
Copy link
Author

@flying-foozy flying-foozy commented Aug 22, 2019

I confirmed that completion at find-file works as expected even in previously problematic case! Thanks!

astoff pushed a commit to astoff/swiper that referenced this issue Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants