[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 496a5e2 105/395: counsel.el: Fix ivy-occur iv
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 496a5e2 105/395: counsel.el: Fix ivy-occur ivy--regex-function bug |
Date: |
Thu, 25 Feb 2021 08:31:41 -0500 (EST) |
branch: externals/ivy-hydra
commit 496a5e298add93690711fdc0b113126ae3f9f221
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
counsel.el: Fix ivy-occur ivy--regex-function bug
When `ivy--regex-function' is overwritten by e.g. `swiper',
`ivy-occur-revert-buffer' fails. Fix this by saving this data in
`ivy-last'.
---
counsel.el | 2 +-
ivy-test.el | 11 ++++++-----
ivy.el | 13 +++++++------
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/counsel.el b/counsel.el
index b0c7dbe..1dd867c 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2835,7 +2835,7 @@ NEEDLE is the search string."
(defun counsel--grep-regex (str)
(counsel--elisp-to-pcre
(setq ivy--old-re
- (funcall ivy--regex-function str))
+ (funcall (ivy-state-re-builder ivy-last) str))
counsel--regex-look-around))
(defun counsel--ag-extra-switches (regex)
diff --git a/ivy-test.el b/ivy-test.el
index fb6d849..2e9e25b 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -44,6 +44,8 @@
(message "%s" (emacs-version))
+(setq ivy-last (make-ivy-state))
+
(ert-deftest ivy--lazy-load-ffap--ffap-url-p ()
(should (not (memq 'ffap require-features)))
(should (not (fboundp 'ffap-url-p)))
@@ -401,7 +403,6 @@ will bring the behavior in line with the newer Emacsen."
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"))
@@ -1128,14 +1129,14 @@ a buffer visiting a file."
;; negative lookahead: lines with "ivy", without "-"
(should
(string=
- (let ((counsel--regex-look-around t)
- (ivy--regex-function 'ivy--regex-plus))
+ (cl-letf ((counsel--regex-look-around t)
+ ((ivy-state-re-builder ivy-last) #'ivy--regex-plus))
(counsel--grep-regex "ivy ! -"))
"^(?=.*ivy)(?!.*-)"))
(should
(string=
- (let ((counsel--regex-look-around t)
- (ivy--regex-function 'ivy--regex-fuzzy))
+ (cl-letf ((counsel--regex-look-around t)
+ ((ivy-state-re-builder ivy-last) #'ivy--regex-fuzzy))
(counsel--grep-regex "ivy"))
"(i)[^v\n]*(v)[^y\n]*(y)")))
diff --git a/ivy.el b/ivy.el
index f0f02cb..9008c1c 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2225,12 +2225,13 @@ This is useful for recursive `ivy-read'."
(setq ivy--extra-candidates (ivy--compute-extra-candidates caller))
(setq ivy--directory nil)
(setq ivy-case-fold-search ivy-case-fold-search-default)
- (setq ivy--regex-function
- (or re-builder
- (and (functionp collection)
- (cdr (assq collection ivy-re-builders-alist)))
- (ivy-alist-setting ivy-re-builders-alist)
- #'ivy--regex))
+ (setf (ivy-state-re-builder ivy-last)
+ (setq ivy--regex-function
+ (or re-builder
+ (and (functionp collection)
+ (cdr (assq collection ivy-re-builders-alist)))
+ (ivy-alist-setting ivy-re-builders-alist)
+ #'ivy--regex)))
(setq ivy--subexps 0)
(setq ivy--regexp-quote #'regexp-quote)
(setq ivy--old-text "")
- [elpa] externals/ivy-hydra accc0fe 339/395: counsel.el (counsel-compile--probe-make-targets): fail more gracefully, (continued)
- [elpa] externals/ivy-hydra accc0fe 339/395: counsel.el (counsel-compile--probe-make-targets): fail more gracefully, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 215bb22 348/395: ivy.el (ivy-configure): Only change a value if it was not modified by the user, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4894b65 329/395: ivy-avy.el: Don't overwrite existing ivy-minibuffer-map binding, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8783d92 321/395: ivy.el: Remove most minibuffer-only commands from the counsel-M-x list, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 40634b7 349/395: ivy.el (ivy--alist-set): Don't touch values set by customize, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 721a3b7 371/395: Make ivy-mode more careful when setting globals, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5de2662 372/395: counsel.el (counsel-linux-app): Clean up env part of the cmd, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d2891aa 376/395: Percent-encode counsel-search query, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f90c018 389/395: counsel.el (counsel-grep-like-occur): Use ivy-text as backup, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3c53de1 390/395: * .elpaignore: New file., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 496a5e2 105/395: counsel.el: Fix ivy-occur ivy--regex-function bug,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 6b4f43a 111/395: ivy.el (ivy--update-minibuffer): Return string, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0ce0bf1 123/395: counsel.el (counsel-evil-marks): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e05bc45 108/395: ivy.el (ivy--recompute-index): Take one less argument, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 723e4d6 126/395: counsel.el: Point to evil-common for evil-global-marker-p declaration., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 04e7942 130/395: counsel-kmacro: Small improvements to functions and documentation strings., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4d161cc 128/395: counsel-kmacro: Clarify copying of values for next macro user defines., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 16298bc 137/395: ivy.el (ivy-read-action-format-function): Upgrade to defcustom, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 269583d 125/395: counsel.el (counsel-locate-cmd-es): Switch flags order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 098f8fe 133/395: swiper.el (swiper-isearch-toggle): Fix up, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b20a6db 135/395: counsel.el (counsel-recentf-candidates): Sort remote files better, Basil L. Contovounesios, 2021/02/25