[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4b17d9a 27/54: Fix up the "foo ! bar" matching and highlig
From: |
Oleh Krehel |
Subject: |
[elpa] master 4b17d9a 27/54: Fix up the "foo ! bar" matching and highlighting |
Date: |
Tue, 29 Sep 2015 14:09:56 +0000 |
branch: master
commit 4b17d9a8147c5f36d2211bc8e515dda55578d3b2
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Fix up the "foo ! bar" matching and highlighting
* ivy.el (ivy--filter): When regex returned is a list, use only the
first string part.
* swiper.el (swiper--update-input-ivy): When regex returned is a list,
use only the first string part.
---
ivy.el | 15 ++++++++-------
swiper.el | 3 ++-
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/ivy.el b/ivy.el
index 9a76f82..5574cd4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1429,6 +1429,7 @@ all of the text contained in the minibuffer."
"Return all items that match NAME in CANDIDATES.
CANDIDATES are assumed to be static."
(let* ((re (funcall ivy--regex-function name))
+ (re-str (if (listp re) (caar re) re))
(matcher (ivy-state-matcher ivy-last))
(case-fold-search (string= name (downcase name)))
(cands (cond
@@ -1469,17 +1470,17 @@ CANDIDATES are assumed to be static."
(tail (nthcdr ivy--index ivy--old-cands))
idx)
(when (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
- (unless (and (not (equal re ivy--old-re))
+ (unless (and (not (equal re-str ivy--old-re))
(or (setq ivy--index
(or
- (cl-position (if (and (> (length re) 0)
- (eq ?^ (aref re 0)))
- (substring re 1)
- re) cands
+ (cl-position (if (and (> (length re-str) 0)
+ (eq ?^ (aref re-str 0)))
+ (substring re-str 1)
+ re-str) cands
:test #'equal)
(and ivy--directory
(cl-position
- (concat re "/") cands
+ (concat re-str "/") cands
:test #'equal))))))
(while (and tail (null idx))
;; Compare with eq to handle equal duplicates in cands
@@ -1490,7 +1491,7 @@ CANDIDATES are assumed to be static."
(or (cl-position (ivy-state-preselect ivy-last)
cands :test #'equal)
ivy--index)))
- (setq ivy--old-re (if cands re ""))
+ (setq ivy--old-re (if cands re-str ""))
(setq ivy--old-cands cands)))
(defvar ivy-format-function 'ivy-format-function-default
diff --git a/swiper.el b/swiper.el
index 7535253..ac1b0cc 100644
--- a/swiper.el
+++ b/swiper.el
@@ -309,7 +309,8 @@ Please remove it and update the \"swiper\" package."))
"Called when `ivy' input is updated."
(with-ivy-window
(swiper--cleanup)
- (let* ((re (ivy--regex ivy-text))
+ (let* ((re (funcall ivy--regex-function ivy-text))
+ (re (if (stringp re) re (caar re)))
(str ivy--current)
(num (if (string-match "^[0-9]+" str)
(string-to-number (match-string 0 str))
- [elpa] master 67cd682 06/54: Fix #126 again., (continued)
- [elpa] master 67cd682 06/54: Fix #126 again., Oleh Krehel, 2015/10/07
- [elpa] master 1f64cb8 11/54: ivy: enlarge the minibuffer window if the candiate list doesn't fit, Oleh Krehel, 2015/10/07
- [elpa] master f164cfe 33/54: counsel.el (counsel-yank-pop): New command, Oleh Krehel, 2015/10/07
- [elpa] master 03d93f7 40/54: ivy.el (ivy-switch-buffer): Make "M-o r" rename buffer, Oleh Krehel, 2015/10/07
- [elpa] master 8d754de 17/54: ivy.el (ivy-display-style): New defcustom, Oleh Krehel, 2015/10/07
- [elpa] master efd1f09 48/54: Make ivy-display-style more compatible with 24.3, Oleh Krehel, 2015/10/07
- [elpa] master b45d10c 43/54: Revert multiple frames workaround, Oleh Krehel, 2015/10/07
- [elpa] master 3ce7df8 49/54: Truncate minibuffer prompts longer than window-width, Oleh Krehel, 2015/10/07
- [elpa] master 78499dd 22/54: Add default values for minibuffer faces, Oleh Krehel, 2015/10/07
- [elpa] master dad8183 23/54: Make the minibuffer faces look nicer, Oleh Krehel, 2015/10/07
- [elpa] master 4b17d9a 27/54: Fix up the "foo ! bar" matching and highlighting,
Oleh Krehel <=
- [elpa] master d3f1f2c 18/54: Add extra faces for minibuffer highlighting, Oleh Krehel, 2015/10/07
- [elpa] master 1bf45be 21/54: ivy.el (ivy--format-minibuffer-line): Fix nil regexp, Oleh Krehel, 2015/10/07
- [elpa] master e03d968 50/54: ivy.el (ivy--insert-prompt): Avoid negative length error, Oleh Krehel, 2015/10/07
- [elpa] master 7a2070b 45/54: Fix minibuffer collapse in text mode emacs, Oleh Krehel, 2015/10/07
- [elpa] master ba49407 53/54: counsel.el (counsel-ag-function): Improve for fancy faces, Oleh Krehel, 2015/10/07
- [elpa] master 00d8f08 12/54: counsel.el (counsel-org-tag): Now works in agenda, Oleh Krehel, 2015/10/07
- [elpa] master 860e276 13/54: Add swiper-multi command, Oleh Krehel, 2015/10/07
- [elpa] master 5269b79 07/54: When initial input contains a plus, escape it, Oleh Krehel, 2015/10/07
- [elpa] master 59908cd 20/54: Make ivy-current blend correctly for fancy minibuffer, Oleh Krehel, 2015/10/07
- [elpa] master 5eac62d 26/54: Move swiper-minibuffer-faces to ivy.el, Oleh Krehel, 2015/10/07