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

Can't create new <object> using Ivy when a match exists. #7752

Open
gilbertw1 opened this Issue Nov 16, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@gilbertw1
Copy link
Contributor

gilbertw1 commented Nov 16, 2016

Description :octocat:

When using Ivy can't create any 'object' whose name matches part of an existing match in the minibuffer. This affects a number of different functions including layouts, creating files, renaming files, virtually anything that opens an ivy completion, yet also allows for a new non-match (:require-match nil) value.

For example if I were to try and create a new file using SPC f f called 'Module.scala' and had an existing file in the same directory called 'LongNameModule.scala', the ivy buffer would only show 'LongNameModule.scala' as a selectable match and provides no way to actually create 'Module.scala'. A similar problem would occur if I tried to create a layout 'emacs' using SPC b b and a layout named 'emacs-test' already existed.

Using helm either of these scenarios would show an exact match under a heading that says 'Create ...' that is selectable.

This presents a pretty big hurdle when using the Ivy layer since spacemacs uses this pattern pretty pervasively and is the primary way to create files / layers / buffers / etc.

Reproduction guide 🐞

  • Start Emacs
  • Press SPC f f
  • Attempt to create file 'Module.scala' in directory that contains 'LongNameModule.scala'

Observed behaviour: 👀 💔
No option to create the file 'Module.scala'

Expected behaviour: ❤️ 😄
'Module.scala' should be a selectable option in some way allowing me to create the file.

@gilbertw1

This comment has been minimized.

Copy link
Contributor

gilbertw1 commented Nov 16, 2016

After a bit more digging, I found that ivy has ivy-immediate-done which is bound to C-M-j. This will exit with the current input which will allow me to create something that doesn't show up in the match list. Maybe we can find some way expose this functionality in a more Spacemacs friendly way?

Since <return> selects a match, maybe simply binding ivy-immediate-done to C-<return> or M-<return> would suffice along with mentioning this in the documentation?

@gilbertw1

This comment has been minimized.

Copy link
Contributor

gilbertw1 commented Nov 16, 2016

After using C-<return> to enter a non-match, I can say that I actually prefer this method to having to select it from the completion list in Helm.

@duianto

This comment has been minimized.

Copy link
Contributor

duianto commented Jun 23, 2017

It's now possible to select the "Find File: " prompt with a partial name of a current match.

This capability was added by @fabacino with this PR:
ivy.el: Make prompt line selectable abo-abo/swiper#1059

Set the new ivy-use-selectable-prompt variable to t, and move up the selection C-p to the prompt above the first match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment