branch: master
commit 7cea8194940e49680bb1cc7c690c7412632234bd
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el: Add `ivy-exit'
* ivy.el (ivy-done): Update.
(ivy-read): Update.
(ivy-exit): New defvar.
---
ivy.el | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ivy.el b/ivy.el
index e4c7fe0..b922df5 100644
--- a/ivy.el
+++ b/ivy.el
@@ -72,6 +72,7 @@
(interactive)
(delete-minibuffer-contents)
(insert ivy--current)
+ (setq ivy-exit 'done)
(exit-minibuffer))
(defun ivy-next-line ()
@@ -117,6 +118,7 @@ UPDATE-FN is called each time the current candidate(s) is
changed."
(setq ivy-text "")
(setq ivy--all-candidates collection)
(setq ivy--update-fn update-fn)
+ (setq ivy-exit nil)
(unwind-protect
(minibuffer-with-setup-hook
#'ivy--minibuffer-setup
@@ -126,6 +128,10 @@ UPDATE-FN is called each time the current candidate(s) is
changed."
(defvar ivy-text ""
"Stores the user's string as it is typed in.")
+(defvar ivy-exit nil
+ "Store 'done if the completion was successfully selected.
+Otherwise, store nil.")
+
;;* Implementation
;;** Regex
(defvar ivy--subexps 0