[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 16eb4a2 31/57: When completing file names, defer to `minib
From: |
Oleh Krehel |
Subject: |
[elpa] master 16eb4a2 31/57: When completing file names, defer to `minibuffer-complete' for "TAB" |
Date: |
Tue, 19 May 2015 14:21:32 +0000 |
branch: master
commit 16eb4a22e1b7b4207f0a6df06d246c0d5caf398c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
When completing file names, defer to `minibuffer-complete' for "TAB"
* ivy.el (ivy-partial-or-done): Call `minibuffer-complete'. If the
resulting text is a valid directory, move there.
(ivy-read): Setup `minibuffer-completion-table' and
`minibuffer-completion-predicate'. This makes `minibuffer-complete'
work.
Fixes #92
---
ivy.el | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index 9b6ef69..fc6759a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -293,10 +293,16 @@ When ARG is t, exit with current text, ignoring the
candidates."
When called twice in a row, exit the minibuffer with the current
candidate."
(interactive)
- (or (ivy-partial)
- (if (eq this-command last-command)
- (ivy-done)
- (ivy-alt-done))))
+ (if (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
+ (progn
+ (minibuffer-complete)
+ (setq ivy-text (ivy--input))
+ (when (file-directory-p ivy-text)
+ (ivy--cd ivy-text)))
+ (or (ivy-partial)
+ (if (eq this-command last-command)
+ (ivy-done)
+ (ivy-alt-done)))))
(defun ivy-partial ()
"Complete the minibuffer text as much as possible."
@@ -685,6 +691,8 @@ RE-BUILDER is a lambda that transforms text into a regex."
(minibuffer-with-setup-hook
#'ivy--minibuffer-setup
(let* ((hist (or history 'ivy-history))
+ (minibuffer-completion-table collection)
+ (minibuffer-completion-predicate predicate)
(res (read-from-minibuffer
prompt
initial-input
- [elpa] master cf292da 23/57: Declare swiper-map, (continued)
- [elpa] master cf292da 23/57: Declare swiper-map, Oleh Krehel, 2015/05/19
- [elpa] master a953af0 19/57: Simplify ivy-partial-or-done, Oleh Krehel, 2015/05/19
- [elpa] master fe34d2c 10/57: ivy.el (ivy-partial-or-done): Handle empty input, Oleh Krehel, 2015/05/19
- [elpa] master 77abf00 25/57: ivy.el (ivy-backward-kill-word): Add and bind to "M-DEL", Oleh Krehel, 2015/05/19
- [elpa] master 8c936bc 21/57: ivy.el (ivy-use-virtual-buffers): New defcustom, Oleh Krehel, 2015/05/19
- [elpa] master 9b9885d 33/57: ivy.el (ivy-partial-or-done): Fixup, Oleh Krehel, 2015/05/19
- [elpa] master d841418 24/57: Fix the transition from a bad regex to good one, Oleh Krehel, 2015/05/19
- [elpa] master 2ad5fb1 20/57: Add support for virtual buffers, Oleh Krehel, 2015/05/19
- [elpa] master f97622d 30/57: swiper.el (swiper-font-lock-ensure): Ignore fundamental-mode, Oleh Krehel, 2015/05/19
- [elpa] master 6d4f2b3 34/57: Fix the error switching to non-existent buffers, Oleh Krehel, 2015/05/19
- [elpa] master 16eb4a2 31/57: When completing file names, defer to `minibuffer-complete' for "TAB",
Oleh Krehel <=
- [elpa] master b63c358 35/57: Properly update virtual buffers for "^ " interaction, Oleh Krehel, 2015/05/19
- [elpa] master d8f79fa 43/57: ivy.el (ivy-partial-or-done): Update doc, Oleh Krehel, 2015/05/19
- [elpa] master ce0efb3 29/57: Allow to customize the minibuffer formatter, Oleh Krehel, 2015/05/19
- [elpa] master 9a2083a 27/57: Swiper should use the :re-builder argument, Oleh Krehel, 2015/05/19
- [elpa] master d8c2ef3 45/57: ivy.el (ivy-partial-or-done): More predictability, Oleh Krehel, 2015/05/19
- [elpa] master e05e3b7 39/57: ivy.el (ivy-read): Keep the last ivy--index for :dynamic-collection, Oleh Krehel, 2015/05/19
- [elpa] master 1cdb6ed 32/57: ivy.el (ivy-partial-or-done): Fixup, Oleh Krehel, 2015/05/19
- [elpa] master 5f2cf0c 28/57: Update test, Oleh Krehel, 2015/05/19
- [elpa] master 6405cb3 42/57: ivy.el (ivy-partial-or-done): Always forward to `ivy-alt-done', Oleh Krehel, 2015/05/19
- [elpa] master 10f9954 50/57: counsel.el (counsel-git-grep): Warn if not in a repository, Oleh Krehel, 2015/05/19