[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f2a0966 16/57: Add ivy-partial: partial complete without e
From: |
Oleh Krehel |
Subject: |
[elpa] master f2a0966 16/57: Add ivy-partial: partial complete without exiting |
Date: |
Tue, 19 May 2015 14:21:25 +0000 |
branch: master
commit f2a09664bddff377dffec651b403d078c835300a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add ivy-partial: partial complete without exiting
* ivy.el (ivy-partial-or-done): Forward to `ivy-partial'.
(ivy-partial): New defun.
If you want a different style of completion for "TAB", do this in your
config:
(define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)
Fixes #85
Fixes #86
---
ivy.el | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/ivy.el b/ivy.el
index 9adeae0..48dde66 100644
--- a/ivy.el
+++ b/ivy.el
@@ -271,23 +271,30 @@ candidate."
(interactive)
(if (eq this-command last-command)
(ivy-alt-done)
- (let* ((parts (or (split-string ivy-text " " t) (list "")))
- (postfix (car (last parts)))
- (completion-ignore-case t)
- (new (try-completion postfix
- (mapcar (lambda (str) (substring str
(string-match postfix str)))
- ivy--old-cands))))
- (if new
- (progn
- (delete-region (minibuffer-prompt-end) (point-max))
- (setcar (last parts) new)
- (insert (mapconcat #'identity parts " ")
- (if ivy-tab-space " " "")))
- (when (and (eq confirm-nonexistent-file-or-buffer t)
- (memq (ivy-state-collection ivy-last)
- '(read-file-name-internal
- internal-complete-buffer)))
- (ivy-done))))))
+ (unless (ivy-partial)
+ (when (and (eq confirm-nonexistent-file-or-buffer t)
+ (memq (ivy-state-collection ivy-last)
+ '(read-file-name-internal
+ internal-complete-buffer)))
+ (ivy-done)))))
+
+(defun ivy-partial ()
+ "Complete the minibuffer text as much as possible."
+ (interactive)
+ (let* ((parts (or (split-string ivy-text " " t) (list "")))
+ (postfix (car (last parts)))
+ (completion-ignore-case t)
+ (new (try-completion postfix
+ (mapcar (lambda (str) (substring str
(string-match postfix str)))
+ ivy--old-cands))))
+ (cond ((eq new t)
+ nil)
+ (new
+ (delete-region (minibuffer-prompt-end) (point-max))
+ (setcar (last parts) new)
+ (insert (mapconcat #'identity parts " ")
+ (if ivy-tab-space " " ""))
+ t))))
(defun ivy-immediate-done ()
"Exit the minibuffer with the current input."
- [elpa] master updated (e559638 -> 155f2a6), Oleh Krehel, 2015/05/19
- [elpa] master ca91c88 01/57: Add an option for out-of-order matching, Oleh Krehel, 2015/05/19
- [elpa] master 4ad1ab2 02/57: ivy.el (ivy-tab-space): New defcustom, Oleh Krehel, 2015/05/19
- [elpa] master 41bc3e8 03/57: Ignore case for "TAB", Oleh Krehel, 2015/05/19
- [elpa] master 2c39e10 04/57: "TAB" shouldn't delete input when no candidate, Oleh Krehel, 2015/05/19
- [elpa] master 2d7f287 09/57: Improve "TAB" interaction with `confirm-nonexistent-file-or-buffer', Oleh Krehel, 2015/05/19
- [elpa] master 03ab827 07/57: Merge ivy--collection into ivy-last, Oleh Krehel, 2015/05/19
- [elpa] master dc219b3 12/57: Add counsel-load-library, Oleh Krehel, 2015/05/19
- [elpa] master 8b08cc0 08/57: ivy.el (ivy-done): Simplify and improve, Oleh Krehel, 2015/05/19
- [elpa] master cd083cc 18/57: Add swiper -> avy finalizer, Oleh Krehel, 2015/05/19
- [elpa] master f2a0966 16/57: Add ivy-partial: partial complete without exiting,
Oleh Krehel <=
- [elpa] master 386184b 14/57: Merge ivy--update-fn into ivy-last, Oleh Krehel, 2015/05/19
- [elpa] master c5fce64 05/57: Make "TAB" switch directories properly, Oleh Krehel, 2015/05/19
- [elpa] master 6784185 17/57: Allow to use "^" in swiper, Oleh Krehel, 2015/05/19
- [elpa] master fb3fce9 13/57: Add parents using 'display for `counsel-load-library', Oleh Krehel, 2015/05/19
- [elpa] master 5601653 06/57: Require dired when completing file names, Oleh Krehel, 2015/05/19
- [elpa] master 4a7ba2f 15/57: Try to prevent the resize of minibuffer window, Oleh Krehel, 2015/05/19
- [elpa] master 5a451a9 26/57: ivy.el (ivy-read): Add a re-builder argument, Oleh Krehel, 2015/05/19
- [elpa] master f7fc3ad 11/57: Work around grep-read-files, Oleh Krehel, 2015/05/19
- [elpa] master 056614d 22/57: Rename avy-swiper to swiper-avy, Oleh Krehel, 2015/05/19
- [elpa] master cf292da 23/57: Declare swiper-map, Oleh Krehel, 2015/05/19