From ea1a1805b3b5f721977fa17415127cab85b652a1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 May 2020 16:28:48 -0400 Subject: [PATCH] Fix projectile failing to index symlinks Fixes cases where, if the contents of your ~/.doom.d were symlinks, fd and ripgrep wouldn't index them (or recurse into them), so it'd miss out of many files. Possibly fixes #1803 --- core/core-projects.el | 4 ++-- modules/completion/ivy/config.el | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core-projects.el b/core/core-projects.el index d2f5180a5..74d403985 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -146,7 +146,7 @@ c) are not valid projectile projects." ;; .gitignore. This is recommended in the projectile docs. ((executable-find doom-projectile-fd-binary) (setq projectile-generic-command - (format "%s . --color=never --type f --type l -0 -H -E .git" + (format "%s . --color=never --type file --type symlink --follow -0 -H -E .git" doom-projectile-fd-binary) projectile-git-command projectile-generic-command projectile-git-submodule-command nil @@ -156,7 +156,7 @@ c) are not valid projectile projects." ;; Otherwise, resort to ripgrep, which is also faster than find ((executable-find "rg") (setq projectile-generic-command - (concat "rg -0 --files --color=never --hidden" + (concat "rg -0 --files --follow --color=never --hidden" (cl-loop for dir in projectile-globally-ignored-directories concat (format " --glob '!%s'" dir))) projectile-git-command projectile-generic-command diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index f60c8a692..cd212263a 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -264,9 +264,11 @@ evil-ex-specific constructs, so we disable it solely in evil-ex." :override #'counsel--find-return-list (cl-destructuring-bind (find-program . args) (cond ((executable-find doom-projectile-fd-binary) - (cons doom-projectile-fd-binary (list "-t" "f" "-t" "l" "-E" ".git"))) + (cons doom-projectile-fd-binary + (list "--color=never" "-E" ".git" + "--type" "file" "--type" "symlink" "--follow"))) ((executable-find "rg") - (append (list "rg" "--files" "--color=never" "--hidden" "--no-messages") + (append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages") (cl-loop for dir in projectile-globally-ignored-directories collect "--glob" and collect (concat "!" dir)) (if IS-WINDOWS (list "--path-separator" "/"))))