branch: master
commit 230137be3ea4cce20bed0689481c4fc4394c3867
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-restrict-to-matches): Work for dynamic collection
Re #2168
---
ivy.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ivy.el b/ivy.el
index 5b41319..3427cdb 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4467,8 +4467,12 @@ You can also delete an element from history with
\\[ivy-reverse-i-search-kill]."
"Restrict candidates to current input and erase input."
(interactive)
(delete-minibuffer-contents)
- (setq ivy--all-candidates
- (ivy--filter ivy-text ivy--all-candidates)))
+ (if (ivy-state-dynamic-collection ivy-last)
+ (progn
+ (setf (ivy-state-dynamic-collection ivy-last) nil)
+ (setq ivy--all-candidates ivy--old-cands))
+ (setq ivy--all-candidates
+ (ivy--filter ivy-text ivy--all-candidates))))
;;* Occur
(defvar-local ivy-occur-last nil