From 1e015c5378de5add512f833f30d3f3d11e0c77ed Mon Sep 17 00:00:00 2001 From: Eric Danan Date: Thu, 16 Aug 2018 23:26:19 +0200 Subject: [PATCH] cp-rg: search globally unignored files and dirs --- counsel-projectile.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/counsel-projectile.el b/counsel-projectile.el index 7a1b2e5..684708a 100644 --- a/counsel-projectile.el +++ b/counsel-projectile.el @@ -769,7 +769,14 @@ OPTIONS, if non-nil, is a string containing additional options to be passed to rg. It is read from the minibuffer if the function is called with a prefix argument." (interactive) - (let* ((ignored (mapconcat (lambda (i) + (let* ((unignored (mapconcat (lambda (i) + (concat "--glob " + (shell-quote-argument i) + " ")) + (append (projectile-unignored-files-rel) + (projectile-unignored-directories-rel)) + "")) + (ignored (mapconcat (lambda (i) (concat "--glob " (shell-quote-argument (concat "!" i)) " ")) @@ -781,7 +788,7 @@ is called with a prefix argument." (read-string (projectile-prepend-project-name "rg options: ") ignored 'counsel-projectile-rg-options-history) - (concat ignored options)))) + (concat unignored ignored options)))) (counsel-rg (eval counsel-projectile-rg-initial-input) (projectile-project-root) options