[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c3e38fb 07/12: Remove globbing heuristics for file name co
From: |
Oleh Krehel |
Subject: |
[elpa] master c3e38fb 07/12: Remove globbing heuristics for file name completion |
Date: |
Thu, 23 Apr 2015 18:01:57 +0000 |
branch: master
commit c3e38fb04f9b953908e04df03c884af29e195797
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Remove globbing heuristics for file name completion
* ivy.el (ivy-done): Simplify.
(ivy-alt-done): Simplify.
If you want to exit with the current text, ignoring candidates, use
`ivy-immediate-done' instead. Works for globs as well.
Fixes #55
---
ivy.el | 40 +++++++++++++---------------------------
1 files changed, 13 insertions(+), 27 deletions(-)
diff --git a/ivy.el b/ivy.el
index c270294..55a6152 100644
--- a/ivy.el
+++ b/ivy.el
@@ -171,18 +171,9 @@ When non-nil, it should contain one %d.")
(delete-minibuffer-contents)
(when (cond (ivy--directory
(insert
- (cond ((string-match "\\*" ivy--current)
- ivy--current)
- ((string= ivy-text "")
- (if (equal ivy--current "./")
- ivy--directory
- (expand-file-name ivy--current ivy--directory)))
- ((zerop ivy--length)
- (if (string-match "\\*" ivy-text)
- ivy-text
- (expand-file-name ivy-text ivy--directory)))
- (t
- (expand-file-name ivy--current ivy--directory))))
+ (if (zerop ivy--length)
+ (expand-file-name ivy-text ivy--directory)
+ (expand-file-name ivy--current ivy--directory)))
(setq ivy-exit 'done))
((zerop ivy--length)
(if (memq ivy-require-match
@@ -214,21 +205,16 @@ When ARG is t, exit with current text, ignoring the
candidates."
(if arg
(ivy-immediate-done)
(let (dir)
- (cond ((and ivy--directory
- (= 0 ivy--index)
- (= 0 (length ivy-text)))
- (ivy-done))
-
- ((and ivy--directory
- (cl-plusp ivy--length)
- (file-directory-p
- (setq dir (expand-file-name
- ivy--current ivy--directory))))
- (ivy--cd dir)
- (ivy--exhibit))
-
- (t
- (ivy-done))))))
+ (if (and ivy--directory
+ (not (string= ivy--current "./"))
+ (cl-plusp ivy--length)
+ (file-directory-p
+ (setq dir (expand-file-name
+ ivy--current ivy--directory))))
+ (progn
+ (ivy--cd dir)
+ (ivy--exhibit))
+ (ivy-done)))))
(defun ivy-immediate-done ()
"Exit the minibuffer with the current input."
- [elpa] master updated (f9b63e4 -> c10ba4b), Oleh Krehel, 2015/04/23
- [elpa] master 444f57e 01/12: ivy.el (ivy-done): Don't expand globs, Oleh Krehel, 2015/04/23
- [elpa] master 013fe04 02/12: swiper.el (swiper--ivy): Check for stand-alone ivy, Oleh Krehel, 2015/04/23
- [elpa] master 7032df7 06/12: counsel.el (counsel-git-grep): Fixup, Oleh Krehel, 2015/04/23
- [elpa] master c3e38fb 07/12: Remove globbing heuristics for file name completion,
Oleh Krehel <=
- [elpa] master 886d908 08/12: Exclude jabber-chat-mode from font-lock, Oleh Krehel, 2015/04/23
- [elpa] master 9470e76 09/12: Avoid sorting org refile candidates, Oleh Krehel, 2015/04/23
- [elpa] master cf3ac8f 04/12: ivy.el (ivy-done): Update wrt globs, Oleh Krehel, 2015/04/23
- [elpa] master 725e12a 11/12: ivy.el (Info-current-file): Declare, Oleh Krehel, 2015/04/23
- [elpa] master 37b7d39 03/12: swiper.el (swiper-query-replace): Fix, Oleh Krehel, 2015/04/23
- [elpa] master a70b734 05/12: ivy.el (ivy-backward-delete-char): Expand `ivy--directory', Oleh Krehel, 2015/04/23
- [elpa] master c10ba4b 12/12: Merge commit '725e12a51e837ed75361f9f2258a887cacb120cd' from swiper, Oleh Krehel, 2015/04/23
- [elpa] master 9b315e8 10/12: Use "//" to move to root instead of "/" as before, Oleh Krehel, 2015/04/23