[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 533b788 11/22: ivy.el (ivy-done): Be more strict for `requ
From: |
Oleh Krehel |
Subject: |
[elpa] master 533b788 11/22: ivy.el (ivy-done): Be more strict for `require-match' |
Date: |
Wed, 22 Apr 2015 19:51:49 +0000 |
branch: master
commit 533b7885ecc69c4e1275ec93a066283a31ba50ac
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-done): Be more strict for `require-match'
When `require-match' isn't in (nil confirm confirm-after-completion),
don't allow to exit if there isn't a match. Instead, amend the prompt
with "(match required)".
---
ivy.el | 59 +++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/ivy.el b/ivy.el
index 8619f3e..e6b07d4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -165,28 +165,43 @@ When non-nil, it should contain one %d.")
"Exit the minibuffer with the selected candidate."
(interactive)
(delete-minibuffer-contents)
- (cond (ivy--directory
- (insert
- (cond ((string= ivy-text "")
- (if (equal ivy--current "./")
- ivy--directory
- (if (string-match "\\*" ivy--current)
- ivy--current
- (expand-file-name ivy--current ivy--directory))))
- ((zerop ivy--length)
- (expand-file-name ivy-text ivy--directory))
- (t
- (expand-file-name ivy--current ivy--directory))))
- (setq ivy-exit 'done))
- ((zerop ivy--length)
- (when (memq ivy-require-match
- '(nil confirm confirm-after-completion))
- (insert ivy-text)
- (setq ivy-exit 'done)))
- (t
- (insert ivy--current)
- (setq ivy-exit 'done)))
- (exit-minibuffer))
+ (when (cond (ivy--directory
+ (insert
+ (cond ((string= ivy-text "")
+ (if (equal ivy--current "./")
+ ivy--directory
+ (if (string-match "\\*" ivy--current)
+ ivy--current
+ (expand-file-name ivy--current ivy--directory))))
+ ((zerop ivy--length)
+ (expand-file-name ivy-text ivy--directory))
+ (t
+ (expand-file-name ivy--current ivy--directory))))
+ (setq ivy-exit 'done))
+ ((zerop ivy--length)
+ (if (memq ivy-require-match
+ '(nil confirm confirm-after-completion))
+ (if (= ivy--length 0)
+ t
+ (insert ivy-text)
+ (setq ivy-exit 'done))
+ (progn
+ (unless (string-match "match required" ivy--prompt)
+ (setq ivy--prompt
+ (if (string-match ": $" ivy--prompt)
+ (concat
+ (substring ivy--prompt 0 -2)
+ " (match required): ")
+ (concat
+ ivy--prompt
+ "(match required) "))))
+ (insert ivy-text)
+ (ivy--exhibit)
+ nil)))
+ (t
+ (insert ivy--current)
+ (setq ivy-exit 'done)))
+ (exit-minibuffer)))
(defun ivy-alt-done (&optional arg)
"Exit the minibuffer with the selected candidate.
- [elpa] master updated (e86b27e -> c7a6156), Oleh Krehel, 2015/04/22
- [elpa] master dea7858 01/22: counsel.el (counsel-git-grep-count): Ignore case, Oleh Krehel, 2015/04/22
- [elpa] master c6652b2 02/22: swiper.el (swiper--add-overlays): Make bounds optional, Oleh Krehel, 2015/04/22
- [elpa] master 769023b 03/22: ivy.el (ivy-read): Use initial-input when completing files, Oleh Krehel, 2015/04/22
- [elpa] master 12c25a0 04/22: ivy.el (ivy-read): Don't add the `default-directory', Oleh Krehel, 2015/04/22
- [elpa] master 37d371c 05/22: Add a way to exit ignoring the candidates, Oleh Krehel, 2015/04/22
- [elpa] master 4adc074 06/22: Fix the default-directory for `counsel-git-grep', Oleh Krehel, 2015/04/22
- [elpa] master dd559ad 07/22: ivy.el (ivy--filter): Try directory expansion with "/", Oleh Krehel, 2015/04/22
- [elpa] master 6da7819 09/22: ivy.el (ivy--filter): Update prefix optimization, Oleh Krehel, 2015/04/22
- [elpa] master 533b788 11/22: ivy.el (ivy-done): Be more strict for `require-match',
Oleh Krehel <=
- [elpa] master fb805a0 08/22: README.md: Add a note on outdated ivy package, Oleh Krehel, 2015/04/22
- [elpa] master 70c5fe8 13/22: Bind "M-q" to `ivy-toggle-regexp-quote', Oleh Krehel, 2015/04/22
- [elpa] master 7edfbc9 14/22: ivy.el (ivy--exhibit): Wrap in `while-no-input', Oleh Krehel, 2015/04/22
- [elpa] master 1fad831 10/22: Change `ivy-read' to a cl-defun, Oleh Krehel, 2015/04/22
- [elpa] master e78557a 15/22: swiper.el (swiper--ivy): Fix preselect being added, Oleh Krehel, 2015/04/22
- [elpa] master 28abaa9 12/22: Allow to customize the regex matching per-collection, Oleh Krehel, 2015/04/22
- [elpa] master dd4aced 16/22: ivy.el (ivy--add-face): Don't fail for weird str, Oleh Krehel, 2015/04/22
- [elpa] master 6d801a6 19/22: ivy-test.el (ivy-read): Update test., Oleh Krehel, 2015/04/22
- [elpa] master 5c03c2b 18/22: ivy.el (ivy-read): Fix preselect logic, Oleh Krehel, 2015/04/22
- [elpa] master f9947de 20/22: Fixup `swiper-query-replace', Oleh Krehel, 2015/04/22