branch: elpa/helm
commit f50e7254f553e7b4d25fcf559f5ec8c410179ac3
Author: Ta Quang Trung <taquangtrun...@gmail.com>
Commit: Ta Quang Trung <taquangtrun...@gmail.com>

    helm-grep: support projectile project
---
 helm-grep.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/helm-grep.el b/helm-grep.el
index 7c569264cd..2962f0b294 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -1857,9 +1857,15 @@ With prefix arg prompt for type if available with your 
AG version."
   (require 'helm-files)
   (require 'project)
   (helm-aif (project-current)
-      (let* ((project-root (expand-file-name (car (last it))))
-             (default-directory project-root))
-        (helm-grep-ag project-root arg))
+      (let* ((project-type (car it))
+             (project-root (cond ((equal project-type 'vc)
+                                  (car (last it)))
+                                 ((equal project-type 'projectile)
+                                  (cdr it))
+                                 (t default-directory)))
+             (project-root-abs (expand-file-name project-root))
+             (default-directory project-root-abs))
+        (helm-grep-ag project-root-abs arg))
     (message "Not in any project!")))
 
 ;;;###autoload

Reply via email to