[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f6f3963 09/63: Bind case-fold-search to t when the input i
From: |
Oleh Krehel |
Subject: |
[elpa] master f6f3963 09/63: Bind case-fold-search to t when the input is all lower-case |
Date: |
Fri, 21 Aug 2015 12:08:31 +0000 |
branch: master
commit f6f3963f52ac94f6388deb57fef6659612b6deba
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Bind case-fold-search to t when the input is all lower-case
* ivy.el (ivy--filter): Update.
* ivy-test.el (ivy--filter): Add test.
- input "the" matches both "the" and "The".
- input "The" matches only "The".
Fixes #166
---
ivy-test.el | 8 ++++++++
ivy.el | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index af0fc60..10dd8f9 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -114,3 +114,11 @@
#("\nDESCRIPTION\nFUNCTION
LETTERS\nSWITCHES\nDIAGNOSTICS\nEXAMPLE 1\nEXAMPLE 2\nEXAMPLE 3\nSEE
ALSO\nAUTHOR"
0 90 (read-only nil)
90 96 (face ivy-current-match read-only nil)))))
+
+(ert-deftest ivy--filter ()
+ (setq ivy-last (make-ivy-state))
+ (should (equal (ivy--filter "the" '("foo" "the" "The"))
+ '("the" "The")))
+ (should (equal (ivy--filter "The" '("foo" "the" "The"))
+ '("The"))))
+
diff --git a/ivy.el b/ivy.el
index 45ed244..fc11c3d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1279,6 +1279,7 @@ Should be run via minibuffer `post-command-hook'."
CANDIDATES are assumed to be static."
(let* ((re (funcall ivy--regex-function name))
(matcher (ivy-state-matcher ivy-last))
+ (case-fold-search (string= name (downcase name)))
(cands (cond
(matcher
(funcall matcher re candidates))
- [elpa] master updated (b0039dd -> f5dac47), Oleh Krehel, 2015/08/21
- [elpa] master bb953c6 01/63: ivy.el (ivy-restrict-to-matches): Add and bind to "S-SPC", Oleh Krehel, 2015/08/21
- [elpa] master d6452fb 02/63: Add a custom keymap for ivy-switch-buffer, Oleh Krehel, 2015/08/21
- [elpa] master 1aa7520 03/63: Add a custom keymap for counsel-find-file, Oleh Krehel, 2015/08/21
- [elpa] master 9bbf9f9 04/63: Fixup the last two commits, Oleh Krehel, 2015/08/21
- [elpa] master b465c09 06/63: ivy.el (ivy-switch-buffer): Add a multi-action interface, Oleh Krehel, 2015/08/21
- [elpa] master 082fbbc 05/63: Add a multi-action interface for counsel-locate, Oleh Krehel, 2015/08/21
- [elpa] master 548a766 08/63: ivy.el (ivy--reset-state): Fixup, Oleh Krehel, 2015/08/21
- [elpa] master fe6d2b1 07/63: Make ffap work again, Oleh Krehel, 2015/08/21
- [elpa] master f6f3963 09/63: Bind case-fold-search to t when the input is all lower-case,
Oleh Krehel <=
- [elpa] master d5af987 11/63: ivy.el (ivy--reset-state): Fixup, Oleh Krehel, 2015/08/21
- [elpa] master d1f88fa 10/63: ivy.el (ivy-read): Don't put empty string on history, Oleh Krehel, 2015/08/21
- [elpa] master f9974e8 12/63: Allow to see the candidate index via ivy-count-format, Oleh Krehel, 2015/08/21
- [elpa] master 783f7c5 13/63: Update index formatting logic, Oleh Krehel, 2015/08/21
- [elpa] master 3164753 14/63: counsel.el (counsel-locate-history): Add, Oleh Krehel, 2015/08/21
- [elpa] master 19dcc0f 16/63: ivy.el (ivy--regex): Improve for trailing backslash, Oleh Krehel, 2015/08/21
- [elpa] master ea6525e 18/63: ivy.el (ivy-read): Improve ivy-set-actions interaction, Oleh Krehel, 2015/08/21
- [elpa] master e9c2538 19/63: counsel.el (counsel-rhythmbox-history): Add, Oleh Krehel, 2015/08/21
- [elpa] master 21007c2 17/63: Add counsel-rhythmbox, Oleh Krehel, 2015/08/21
- [elpa] master de2e819 20/63: Allow % in prompt string, Oleh Krehel, 2015/08/21