branch: master
commit 61a95c4245e1f1befa5f811afae20a105c54eb38
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
Don't expand the default when completing file names
* ivy.el (ivy-done): Update.
This affects e.g. `rgrep': "\*.el" as the default will work, but
"foo/\*.el" won't.
---
ivy.el | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/ivy.el b/ivy.el
index 784ef0b..92c9771 100644
--- a/ivy.el
+++ b/ivy.el
@@ -152,11 +152,13 @@ When non-nil, it should contain one %d.")
(interactive)
(delete-minibuffer-contents)
(cond (ivy--directory
- (insert (expand-file-name
- (if (zerop ivy--length)
- ivy-text
- ivy--current)
- ivy--directory))
+ (insert
+ (cond ((string= ivy-text "")
+ ivy--current)
+ ((zerop ivy--length)
+ (expand-file-name ivy-text ivy--directory))
+ (t
+ (expand-file-name ivy--current ivy--directory))))
(setq ivy-exit 'done))
((zerop ivy--length)
(when (memq ivy-require-match