branch: master
commit a1e00638df477706bf911269b0cec66570b89306
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy--reset-state): Don't null initial-input
This is specifically for 'read-file-name-internal collection.
The input needs to be set to nil for e.g. `rgrep', which supplies
the *absolute* path as `initial-input', resulting in a mess.
For now, don't set input to nil if :action was passed to `ivy-read'.
Fixes #336
---
ivy.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 8ab8139..244d819 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1228,7 +1228,8 @@ This is useful for recursive `ivy-read'."
(equal initial-input default-directory)
(equal initial-input ""))
(setq coll (cons initial-input coll)))
- (setq initial-input nil)))
+ (unless (ivy-state-action ivy-last)
+ (setq initial-input nil))))
((eq collection 'internal-complete-buffer)
(setq coll (ivy--buffer-list "" ivy-use-virtual-buffers)))
((or (functionp collection)