[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 41732be 48/67: ivy.el: Return nil when there is no match
From: |
Oleh Krehel |
Subject: |
[elpa] master 41732be 48/67: ivy.el: Return nil when there is no match |
Date: |
Sun, 22 Mar 2015 17:34:06 +0000 |
branch: master
commit 41732be041b004b6d0da4617e9bb019ba13832d9
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el: Return nil when there is no match
* ivy.el (ivy-done): Update.
(ivy-read): Update.
---
ivy.el | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/ivy.el b/ivy.el
index 62eb20e..5b2ef39 100644
--- a/ivy.el
+++ b/ivy.el
@@ -81,8 +81,9 @@ of `history-length', which see.")
"Exit the minibuffer with the selected candidate."
(interactive)
(delete-minibuffer-contents)
- (insert ivy--current)
- (setq ivy-exit 'done)
+ (unless (zerop ivy--length)
+ (insert ivy--current)
+ (setq ivy-exit 'done))
(exit-minibuffer))
(defun ivy-next-line ()
@@ -155,16 +156,17 @@ If INDEX is non-nil select the corresponding candidate."
(unwind-protect
(minibuffer-with-setup-hook
#'ivy--minibuffer-setup
- (read-from-minibuffer
- prompt
- initial-input
- ivy-minibuffer-map
- nil
- 'ivy-history))
- (when (eq ivy-exit 'done)
- (pop ivy-history)
- (setq ivy-history
- (cons ivy-text (delete ivy-text ivy-history))))
+ (let ((res (read-from-minibuffer
+ prompt
+ initial-input
+ ivy-minibuffer-map
+ nil
+ 'ivy-history)))
+ (when (eq ivy-exit 'done)
+ (pop ivy-history)
+ (setq ivy-history
+ (cons ivy-text (delete ivy-text ivy-history)))
+ res)))
(remove-hook 'post-command-hook #'ivy--exhibit)))))
(defvar ivy-text ""
- [elpa] master d78caee 33/67: Open invisible overlays using isearch, (continued)
- [elpa] master d78caee 33/67: Open invisible overlays using isearch, Oleh Krehel, 2015/03/22
- [elpa] master 8818a01 36/67: swiper.el: Fix error for empty buffer, Oleh Krehel, 2015/03/22
- [elpa] master 984346c 40/67: swiper.el (swiper-font-lock-ensure): Exclude a few modes, Oleh Krehel, 2015/03/22
- [elpa] master cb26121 41/67: ivy.el: Fix ivy-history recording the full text instead of input, Oleh Krehel, 2015/03/22
- [elpa] master de80846 39/67: Work around magit highlighting problem, Oleh Krehel, 2015/03/22
- [elpa] master 7bb5320 42/67: swiper.el (swiper--helm): Require helm-match-plugin, Oleh Krehel, 2015/03/22
- [elpa] master caa69f2 43/67: counsel.el: Add git file completion, Oleh Krehel, 2015/03/22
- [elpa] master fcb18e5 44/67: ivy.el (ivy-read): Bring last history candidate to front, Oleh Krehel, 2015/03/22
- [elpa] master e32bc63 46/67: swiper.el: Fix non-matching lines issue with initial-input, Oleh Krehel, 2015/03/22
- [elpa] master f1672c7 45/67: Add isearch-like history behavior, Oleh Krehel, 2015/03/22
- [elpa] master 41732be 48/67: ivy.el: Return nil when there is no match,
Oleh Krehel <=
- [elpa] master 588dab6 49/67: ivy-test.el: Add testing, Oleh Krehel, 2015/03/22
- [elpa] master f754835 47/67: swiper.el: Silence a few compilation warnings, Oleh Krehel, 2015/03/22
- [elpa] master cc4bf75 52/67: README.md: Add build status, Oleh Krehel, 2015/03/22
- [elpa] master 2b8e4e1 53/67: ivy.el: Remove while-no-input, Oleh Krehel, 2015/03/22
- [elpa] master 2191bdb 54/67: ivy.el (ivy-completions): Simplify, Oleh Krehel, 2015/03/22
- [elpa] master d587fa2 51/67: ivy.el (ivy-read): Allow for format-style PROMPT, Oleh Krehel, 2015/03/22
- [elpa] master 9f9c4dc 57/67: swiper-helm.el: Fix typo, Oleh Krehel, 2015/03/22
- [elpa] master 3a08a88 50/67: ivy.el (ivy-read): Change index to preselect, Oleh Krehel, 2015/03/22
- [elpa] master d2b2813 55/67: swiper-helm.el: Copy all helm stuff here, Oleh Krehel, 2015/03/22
- [elpa] master c4acef9 56/67: swiper.el: Remove the helm bits, Oleh Krehel, 2015/03/22