[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6e3c692 029/167: Fix ivy-state-preselect for file name com
From: |
Oleh Krehel |
Subject: |
[elpa] master 6e3c692 029/167: Fix ivy-state-preselect for file name completion |
Date: |
Tue, 08 Dec 2015 10:49:42 +0000 |
branch: master
commit 6e3c6925d3b5bd2f7b22adb0f2d3cfd668cc801b
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Fix ivy-state-preselect for file name completion
* ivy.el (ivy--preselect-index): Add a check for null preselect.
(ivy--filter): Use `ivy--preselect-index' instead of `cl-position'. The
reason is that the collection contains e.g "foo/" while the preselect is
"foo".
---
ivy.el | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 64eff1e..59a02bd 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1162,10 +1162,12 @@ When MATCHER is non-nil it's used instead of
`cl-remove-if-not'."
(when matcher
(setq candidates (funcall matcher "" candidates))))
(or (cl-position preselect candidates :test #'equal)
- (cl-position-if
- (lambda (x)
- (string-match (regexp-quote preselect) x))
- candidates)))
+ (and (stringp preselect)
+ (let ((re (regexp-quote preselect)))
+ (cl-position-if
+ (lambda (x)
+ (string-match re x))
+ candidates)))))
;;* Implementation
;;** Regex
@@ -1577,8 +1579,11 @@ CANDIDATES are assumed to be static."
(setq ivy--index 0))
(when (and (string= name "") (not (equal ivy--old-re "")))
(setq ivy--index
- (or (cl-position (ivy-state-preselect ivy-last)
- cands :test #'equal)
+ (or (ivy--preselect-index
+ cands
+ nil
+ (ivy-state-preselect ivy-last)
+ nil)
ivy--index)))
(setq ivy--old-re (if cands re-str ""))
(when (and (require 'flx nil 'noerror)
- [elpa] master 3a3b052 036/167: swiper.el: Add a lot of avy declares, (continued)
- [elpa] master 3a3b052 036/167: swiper.el: Add a lot of avy declares, Oleh Krehel, 2015/12/08
- [elpa] master 3699fa9 041/167: Don't reset the match to first if the current one still works, Oleh Krehel, 2015/12/08
- [elpa] master 877648a 045/167: ivy.el (ivy-case-fold-search): New defvar, Oleh Krehel, 2015/12/08
- [elpa] master 340318d 044/167: ivy-count-format must be an empty string instead of nil, Oleh Krehel, 2015/12/08
- [elpa] master 9cc75eb 050/167: Adjust the swiper regexp builder for the display change, Oleh Krehel, 2015/12/08
- [elpa] master 85682ee 048/167: Fix "C-x h" selection and "C-b" bug, Oleh Krehel, 2015/12/08
- [elpa] master 99698e6 035/167: ivy.el (ivy-dispatching-call): Add and bind to "C-M-o", Oleh Krehel, 2015/12/08
- [elpa] master 0630395 043/167: Fix the count when git-grep for "->foo", Oleh Krehel, 2015/12/08
- [elpa] master 4045349 032/167: ivy.el (ivy-use-virtual-buffers): Update docstring, Oleh Krehel, 2015/12/08
- [elpa] master f9df75e 037/167: ivy.el (ivy-index-functions-alist): New variable, Oleh Krehel, 2015/12/08
- [elpa] master 6e3c692 029/167: Fix ivy-state-preselect for file name completion,
Oleh Krehel <=
- [elpa] master c69b4b6 033/167: ivy.el (ivy-last): Update docstring, Oleh Krehel, 2015/12/08
- [elpa] master b6d476a 042/167: ivy.el (ivy--recompute-index): Fixup, Oleh Krehel, 2015/12/08
- [elpa] master 83f704b 039/167: ivy-hydra.el (hydra-ivy): Make the docstring a rectangle, Oleh Krehel, 2015/12/08
- [elpa] master b06daca 040/167: ivy.el (ivy-virtual-abbreviate): New defcustom, Oleh Krehel, 2015/12/08
- [elpa] master c99956a 047/167: Fix window selection in counsel-locate, Oleh Krehel, 2015/12/08
- [elpa] master fa0d04c 038/167: Move setq ivy--index to ivy--recompute-index, Oleh Krehel, 2015/12/08
- [elpa] master e5105ef 054/167: Don't re-anchor to matching old candidate if flx is on, Oleh Krehel, 2015/12/08
- [elpa] master f4bd3a4 055/167: counsel.el (counsel-ag): Add initial-directory, Oleh Krehel, 2015/12/08
- [elpa] master 79924dc 051/167: swiper.el (swiper--re-builder): Fix "^a" -> "^" case, Oleh Krehel, 2015/12/08
- [elpa] master 2404db1 053/167: Add feedback for long-running async processes, Oleh Krehel, 2015/12/08