emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/anzu 38d49e3664 276/288: Revert "Fix issue #93"


From: ELPA Syncer
Subject: [nongnu] elpa/anzu 38d49e3664 276/288: Revert "Fix issue #93"
Date: Thu, 6 Jan 2022 03:59:00 -0500 (EST)

branch: elpa/anzu
commit 38d49e366486658d3ed8e4fc2093628f689f2eb3
Author: Neil Okamoto <neil.okamoto@gmail.com>
Commit: GitHub <noreply@github.com>

    Revert "Fix issue #93"
---
 anzu.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/anzu.el b/anzu.el
index 0aaae37fe3..72fe2841cb 100644
--- a/anzu.el
+++ b/anzu.el
@@ -163,10 +163,10 @@
 (defsubst anzu--construct-position-info (count overflow positions)
   (list :count count :overflow overflow :positions positions))
 
-(defsubst anzu--case-fold-search ()
-  (if isearch-mode
-      isearch-case-fold-search
-    case-fold-search))
+(defsubst anzu--case-fold-search (input)
+  (when isearch-case-fold-search
+    (let ((case-fold-search nil))
+      (not (string-match-p "[A-Z]" input)))))
 
 (defsubst anzu--word-search-p ()
   (and (not (memq anzu--last-command anzu-regexp-search-commands))
@@ -206,7 +206,7 @@
                                  (with-no-warnings
                                    (migemo-forward word bound noerror count)))
                              #'re-search-forward))
-              (case-fold-search (anzu--case-fold-search)))
+              (case-fold-search (anzu--case-fold-search input)))
           (while (and (not finish) (funcall search-func input nil t))
             (push (cons (match-beginning 0) (match-end 0)) positions)
             (cl-incf count)
@@ -235,8 +235,7 @@
 (defun anzu--use-result-cache-p (input)
   (and (eq (anzu--isearch-regexp-function) (car anzu--last-search-state))
        (eq isearch-regexp (cdr anzu--last-search-state))
-       (string= input anzu--last-isearch-string)
-       (not (eq last-command 'isearch-toggle-case-fold))))
+       (string= input anzu--last-isearch-string)))
 
 (defun anzu--update (query)
   (when (>= (length query) anzu-minimum-input-length)
@@ -586,7 +585,7 @@
     (unless (string= content anzu--last-replace-input)
       (setq anzu--last-replace-input content)
       (with-current-buffer buf
-        (let ((case-fold-search (anzu--case-fold-search)))
+        (let ((case-fold-search (anzu--case-fold-search from)))
           (dolist (ov (anzu--overlays-in-range beg (min end overlay-limit)))
             (let ((replace-evaled
                    (if (not use-regexp)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]