]> code.delx.au - gnu-emacs-elpa/commitdiff
Enable recursive swiper calls
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 27 Nov 2015 13:03:41 +0000 (14:03 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 27 Nov 2015 13:10:46 +0000 (14:10 +0100)
* ivy.el (ivy-read): Don't need to be in the minibuffer to do a
  recursive store/restore.

(ivy--reset-state): Avoid nil string while testing.

Fixes #309

ivy.el

diff --git a/ivy.el b/ivy.el
index ff7b2b213200a192621d10ac7c60f15177b43c7f..e89fbd330e457aeb94c894f3787b375b35819645 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1056,7 +1056,7 @@ customizations apply to the current completion session."
                   ("o" ,action "default")
                   ,@extra-actions)
               (delete-dups (append action extra-actions))))))
-  (let ((recursive-ivy-last (and (window-minibuffer-p) ivy-last)))
+  (let ((recursive-ivy-last ivy-last))
     (setq ivy-last
           (make-ivy-state
            :prompt prompt
@@ -1114,7 +1114,7 @@ customizations apply to the current completion session."
 (defun ivy--reset-state (state)
   "Reset the ivy to STATE.
 This is useful for recursive `ivy-read'."
-  (let ((prompt (ivy-state-prompt state))
+  (let ((prompt (or (ivy-state-prompt state) ""))
         (collection (ivy-state-collection state))
         (predicate (ivy-state-predicate state))
         (history (ivy-state-history state))