[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 41b5850 005/167: ivy.el (ivy--regex-fuzzy): Add minibuffer
From: |
Oleh Krehel |
Subject: |
[elpa] master 41b5850 005/167: ivy.el (ivy--regex-fuzzy): Add minibuffer highlighting |
Date: |
Tue, 08 Dec 2015 10:49:33 +0000 |
branch: master
commit 41b58500e0c978a005b24b332e896d567f28795e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--regex-fuzzy): Add minibuffer highlighting
* ivy-test.el (ivy--regex-fuzzy): Update test.
Re #207
---
ivy-test.el | 7 +++----
ivy.el | 11 ++++++++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index 10dd8f9..76f2dde 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -84,11 +84,11 @@
(ert-deftest ivy--regex-fuzzy ()
(should (string= (ivy--regex-fuzzy "tmux")
- "t.*m.*u.*x"))
+ "\\(t\\).*\\(m\\).*\\(u\\).*\\(x\\)"))
(should (string= (ivy--regex-fuzzy "^tmux")
- "^t.*m.*u.*x"))
+ "^\\(t\\).*\\(m\\).*\\(u\\).*\\(x\\)"))
(should (string= (ivy--regex-fuzzy "^tmux$")
- "^t.*m.*u.*x$"))
+ "^\\(t\\).*\\(m\\).*\\(u\\).*\\(x\\)$"))
(should (string= (ivy--regex-fuzzy "")
""))
(should (string= (ivy--regex-fuzzy "^")
@@ -121,4 +121,3 @@
'("the" "The")))
(should (equal (ivy--filter "The" '("foo" "the" "The"))
'("The"))))
-
diff --git a/ivy.el b/ivy.el
index 0dab956..5f7ed6f 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1226,9 +1226,14 @@ Everything after \"!\" should not match."
"Build a regex sequence from STR.
Insert .* between each char."
(if (string-match "\\`\\(\\^?\\)\\(.*?\\)\\(\\$?\\)\\'" str)
- (concat (match-string 1 str)
- (mapconcat #'string (string-to-list (match-string 2 str)) ".*")
- (match-string 3 str))
+ (prog1
+ (concat (match-string 1 str)
+ (mapconcat
+ (lambda (x)
+ (format "\\(%c\\)" x))
+ (string-to-list (match-string 2 str)) ".*")
+ (match-string 3 str))
+ (setq ivy--subexps (length (match-string 2 str))))
str))
;;** Rest
- [elpa] master updated (a0561bf -> 1f3fa31), Oleh Krehel, 2015/12/08
- [elpa] master a71d5c8 001/167: ivy.el (ivy--insert-prompt): Improve truncation, Oleh Krehel, 2015/12/08
- [elpa] master e70ca07 003/167: ivy.el (ivy-call): "C-M-n" should not leave the minibuffer, Oleh Krehel, 2015/12/08
- [elpa] master 4ad797b 002/167: Improve "C-g" out of a long-running async process, Oleh Krehel, 2015/12/08
- [elpa] master 41b5850 005/167: ivy.el (ivy--regex-fuzzy): Add minibuffer highlighting,
Oleh Krehel <=
- [elpa] master 19d2a40 004/167: Add flx sorting, Oleh Krehel, 2015/12/08
- [elpa] master 3146501 010/167: ivy.el (ivy-resume): Don't regexp-quote preselect, Oleh Krehel, 2015/12/08
- [elpa] master f04aec8 009/167: ivy-hydra.el: Bind "t" to toggle-truncate-lines, Oleh Krehel, 2015/12/08
- [elpa] master 82a317c 011/167: Make swiper compatible with visual-line-mode, Oleh Krehel, 2015/12/08
- [elpa] master 45b54e3 015/167: counsel.el (counsel--gg-count): Fix for "'" in query, Oleh Krehel, 2015/12/08
- [elpa] master 6bf3239 006/167: ivy.el (ivy-yank-word): Add only one space each time, Oleh Krehel, 2015/12/08
- [elpa] master 73e5799 012/167: Fix counsel-git-grep not updating to 0 candidates, Oleh Krehel, 2015/12/08
- [elpa] master dfb41d0 016/167: Implement ivy-avy, Oleh Krehel, 2015/12/08
- [elpa] master eda091b 017/167: Customize ivy-avy and fix compile warnings, Oleh Krehel, 2015/12/08
- [elpa] master fa49a81 018/167: Fix "End of buffer" for swiper and visual-line-mode, Oleh Krehel, 2015/12/08