[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b63c358 35/57: Properly update virtual buffers for "^ " in
From: |
Oleh Krehel |
Subject: |
[elpa] master b63c358 35/57: Properly update virtual buffers for "^ " interaction |
Date: |
Tue, 19 May 2015 14:21:34 +0000 |
branch: master
commit b63c35837b1d559ecac6e3b5156ba09587405fb0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Properly update virtual buffers for "^ " interaction
* ivy.el (ivy-read): Use `ivy--buffer-list'.
(ivy--exhibit): Use `ivy--buffer-list'.
(ivy-add-virtual-buffers): Remove.
(ivy--buffer-list): New defun.
Re #68
---
ivy.el | 39 ++++++++++++++++++---------------------
1 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/ivy.el b/ivy.el
index b9fbf0b..c38fd21 100644
--- a/ivy.el
+++ b/ivy.el
@@ -636,16 +636,7 @@ RE-BUILDER is a lambda that transforms text into a regex."
(setq coll (cons initial-input coll)))
(setq initial-input nil)))
((eq collection 'internal-complete-buffer)
- (setq coll
- (ivy-add-virtual-buffers
- (mapcar
- (lambda (x)
- (if (with-current-buffer x
- (file-remote-p
- (abbreviate-file-name default-directory)))
- (propertize x 'face 'ivy-remote)
- x))
- (all-completions "" collection predicate)))))
+ (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers)))
((or (functionp collection)
(vectorp collection)
(listp (car collection)))
@@ -980,13 +971,11 @@ Should be run via minibuffer `post-command-hook'."
(and (string-match "^ " ivy--old-text)
(not (string-match "^ " ivy-text))))
(setq ivy--all-candidates
- (all-completions
- (if (and (> (length ivy-text) 0)
- (eq (aref ivy-text 0)
- ?\ ))
- " "
- "")
- 'internal-complete-buffer))
+ (if (and (> (length ivy-text) 0)
+ (eq (aref ivy-text 0)
+ ?\ ))
+ (ivy--buffer-list " ")
+ (ivy--buffer-list "" ivy-use-virtual-buffers)))
(setq ivy--old-re nil))))
(ivy--insert-minibuffer
(ivy--format
@@ -1168,12 +1157,20 @@ CANDS is a list of strings."
(setq ivy--virtual-buffers (nreverse virtual-buffers))
(mapcar #'car ivy--virtual-buffers))))
-(defun ivy-add-virtual-buffers (buffer-list)
- "Add virtual buffers to BUFFER-LIST."
+(defun ivy--buffer-list (str &optional virtual)
+ "Return the buffers that match STR.
+When VIRTUAL is non-nil, add virtual buffers."
(delete-dups
(append
- buffer-list
- (and ivy-use-virtual-buffers
+ (mapcar
+ (lambda (x)
+ (if (with-current-buffer x
+ (file-remote-p
+ (abbreviate-file-name default-directory)))
+ (propertize x 'face 'ivy-remote)
+ x))
+ (all-completions str 'internal-complete-buffer))
+ (and virtual
(ivy--virtual-buffers)))))
(defun ivy--switch-buffer-action ()
- [elpa] master a953af0 19/57: Simplify ivy-partial-or-done, (continued)
- [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, 2015/05/19
- [elpa] master b63c358 35/57: Properly update virtual buffers for "^ " interaction,
Oleh Krehel <=
- [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
- [elpa] master 2cedcf5 37/57: Introduce :matcher for counsel-git-grep, Oleh Krehel, 2015/05/19