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

Default value in file name completion #152

Closed
hpdeifel opened this Issue Jun 18, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@hpdeifel

Many file operations (such as copy-file, delete-file or even find-file) provide the current file as default value to completing-read, when called interactively. So copying the current file should only be a M-x copy-file RET M-n RET new-file RET away.

Unfortunately, M-n inserts the whole absolute file name in the minibuffer, which ivy can't handle. (It inserts /current-directory/absolute/path/of/file).

An option would be to detect if the history entry is an absolute path and in that case, replace the whole minibuffer content instead of only the part after the last slash.

@abo-abo abo-abo closed this in e238286 Jun 18, 2015

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jun 18, 2015

Owner

Thanks for pointing this out. Please test this and give feedback. I think it looks OK, I didn't have an Ido behavior for a reference, since there's only ido-find-file and not ido-copy-file.

Owner

abo-abo commented Jun 18, 2015

Thanks for pointing this out. Please test this and give feedback. I think it looks OK, I didn't have an Ido behavior for a reference, since there's only ido-find-file and not ido-copy-file.

abo-abo added a commit that referenced this issue Jun 18, 2015

Put the file instead of partial input on history
* ivy.el (ivy-read): When completing file names, put the whole file name
on history, not just the partial input that lead to that name.
This is important in order for `ivy--cd-maybe' to work.

Re #152
@hpdeifel

This comment has been minimized.

Show comment
Hide comment
@hpdeifel

hpdeifel Jun 19, 2015

works great so far, thanks!

works great so far, thanks!

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