branch: master
commit 0630395232db84ad276457c97c11c29b45a98619
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
Fix the count when git-grep for "->foo"
* counsel.el: For some reason, "-" gets interpreted in a bad way.
Escaping it as "\-" makes it work fine.
---
counsel.el | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/counsel.el b/counsel.el
index 800e907..da1e04c 100644
--- a/counsel.el
+++ b/counsel.el
@@ -718,7 +718,9 @@ The libraries are offered from `load-path'."
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 "'" "''" regex)))
+ (replace-regexp-in-string
+ "-" "\\\\-"
+ (replace-regexp-in-string "'" "''" regex))))
(counsel-ggc-process " *counsel-gg-count*"))
(if no-async
(string-to-number (shell-command-to-string cmd))