branch: externals/ivy-hydra
commit 80101ca9c855ae2241e2e15130caa951b8416f70
Author: Aaron L. Zeng <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>

    counsel.el (counsel-ag-function): User switches override -i/-s
    
    Copyright-paperwork-exempt: yes
    
    Closes #2793.
---
 counsel.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/counsel.el b/counsel.el
index af0ac61..f702ab5 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2991,11 +2991,11 @@ NEEDLE is the search string."
        (ivy-more-chars))
      (let* ((default-directory (ivy-state-directory ivy-last))
             (regex (counsel--grep-regex search-term))
-            (switches (concat (car command-args)
-                              (counsel--ag-extra-switches regex)
-                              (if (ivy--case-fold-p string)
+            (switches (concat (if (ivy--case-fold-p string)
                                   " -i "
-                                " -s "))))
+                                " -s ")
+                              (counsel--ag-extra-switches regex)
+                              (car command-args))))
        (counsel--async-command (counsel--format-ag-command
                                 switches
                                 (funcall (if (listp counsel-ag-command) 
#'identity

Reply via email to