branch: master
commit ddb4681d168ad051c7143495865fbc2d0ea95944
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-git-grep-cmd-default): New defvar
It becomes the initial value for `counsel-git-grep-cmd' in each session,
instead of hard-coding it in `counsel-git-grep'.
---
counsel.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/counsel.el b/counsel.el
index 31022ac..e4b2bc9 100644
--- a/counsel.el
+++ b/counsel.el
@@ -762,7 +762,10 @@ Describe the selected candidate."
(ivy-set-occur 'counsel-git-grep 'counsel-git-grep-occur)
(ivy-set-display-transformer 'counsel-git-grep 'counsel-git-grep-transformer)
-(defvar counsel-git-grep-cmd "git --no-pager grep --full-name -n --no-color -i
-e %S"
+(defvar counsel-git-grep-cmd-default "git --no-pager grep --full-name -n
--no-color -i -e %S"
+ "Initial command for `counsel-git-grep'.")
+
+(defvar counsel-git-grep-cmd nil
"Store the command for `counsel-git-grep'.")
(defvar counsel--git-grep-dir nil
@@ -870,7 +873,7 @@ INITIAL-INPUT can be given as the initial minibuffer input."
(setq counsel-git-grep-cmd-history
(delete-dups counsel-git-grep-cmd-history)))
(t
- (setq counsel-git-grep-cmd "git --no-pager grep --full-name -n --no-color
-i -e %S")))
+ (setq counsel-git-grep-cmd counsel-git-grep-cmd-default)))
(setq counsel--git-grep-dir
(locate-dominating-file default-directory ".git"))
(if (null counsel--git-grep-dir)