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

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

[elpa] externals/ivy-hydra 1396d7b 024/395: counsel.el (counsel-grep): O


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 1396d7b 024/395: counsel.el (counsel-grep): Obey ivy-case-fold-search-default
Date: Thu, 25 Feb 2021 08:31:23 -0500 (EST)

branch: externals/ivy-hydra
commit 1396d7be50c7b885579ff3e41a4320798f0aedf3
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    counsel.el (counsel-grep): Obey ivy-case-fold-search-default
    
    Fixes #1542
---
 counsel.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/counsel.el b/counsel.el
index 7c8b9a9..c38be2d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -3037,11 +3037,16 @@ substituted by the search regexp and file, 
respectively.  Neither
   "Grep in the current directory for STRING."
   (or
    (ivy-more-chars)
-   (let ((regex (counsel--elisp-to-pcre
-                 (setq ivy--old-re
-                       (ivy--regex string)))))
+   (let* ((regex (counsel--elisp-to-pcre
+                  (setq ivy--old-re
+                        (ivy--regex string))))
+          (cmd (format counsel-grep-command (shell-quote-argument regex))))
      (counsel--async-command
-      (format counsel-grep-command (shell-quote-argument regex)))
+      (if (ivy--case-fold-p regex)
+          (progn
+            (string-match " " cmd)
+            (replace-match " -i " nil nil cmd))
+        cmd))
      nil)))
 
 (defvar counsel--grep-last-pos nil



reply via email to

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