branch: master commit 2ae7d74916f93ae11c9dddd9df0c47e4d6b62e77 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
Fix the count in user-specified counsel-git-grep * counsel.el (counsel--gg-count): Generate the count command from `counsel-git-grep-cmd' by replacing "--full-name" with "-c". Re #244 --- counsel.el | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/counsel.el b/counsel.el index 25f1f44..402f55c 100644 --- a/counsel.el +++ b/counsel.el @@ -742,10 +742,17 @@ The libraries are offered from `load-path'." "Quickly and asynchronously count the amount of git grep REGEX matches. When NO-ASYNC is non-nil, do it synchronously." (let ((default-directory counsel--git-grep-dir) - (cmd (format "git grep -i -c '%s' | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END {print s}'" - (replace-regexp-in-string - "-" "\\\\-" - (replace-regexp-in-string "'" "''" regex)))) + (cmd + (concat + (format + (replace-regexp-in-string + "--full-name" "-c" + counsel-git-grep-cmd) + ;; "git grep -i -c '%s'" + (replace-regexp-in-string + "-" "\\\\-" + (replace-regexp-in-string "'" "''" regex))) + " | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END {print s}'")) (counsel-ggc-process " *counsel-gg-count*")) (if no-async (string-to-number (shell-command-to-string cmd))