From 77a4e8f8a77dae2f4eaf7d3dab40d27985634433 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 May 2020 14:02:06 -0400 Subject: [PATCH] Fix switch-project completion defaulting to current project Affects doom/browse-in-other-project, doom/find-file-in-other-project, +default/search-other-project and +default/search-project-for-symbol-at-point. When performing a text or file search in "another project", prior to this update the current project would be the first highlighted candidate, which doesn't make much sense when you're invoking a command for searching *other* projects. --- core/autoload/projects.el | 6 ++---- modules/config/default/autoload/search.el | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/autoload/projects.el b/core/autoload/projects.el index b71623bf6..820607018 100644 --- a/core/autoload/projects.el +++ b/core/autoload/projects.el @@ -41,8 +41,7 @@ they are absolute." "Preforms `projectile-find-file' in a known project of your choosing." (interactive (list - (completing-read "Find file in project: " (projectile-relevant-known-projects) - nil nil nil nil (doom-project-root)))) + (completing-read "Find file in project: " (projectile-relevant-known-projects)))) (unless (file-directory-p project-root) (error "Project directory '%s' doesn't exist" project-root)) (doom-project-find-file project-root)) @@ -52,8 +51,7 @@ they are absolute." "Preforms `find-file' in a known project of your choosing." (interactive (list - (completing-read "Browse in project: " (projectile-relevant-known-projects) - nil nil nil nil (doom-project-root)))) + (completing-read "Browse in project: " (projectile-relevant-known-projects)))) (unless (file-directory-p project-root) (error "Project directory '%s' doesn't exist" project-root)) (doom-project-browse project-root)) diff --git a/modules/config/default/autoload/search.el b/modules/config/default/autoload/search.el index bb3cb2445..53e8f22e9 100644 --- a/modules/config/default/autoload/search.el +++ b/modules/config/default/autoload/search.el @@ -30,8 +30,7 @@ If prefix ARG is set, prompt for a known project to search from." (default-directory (if arg (if-let (projects (projectile-relevant-known-projects)) - (completing-read "Search project: " projects - nil t nil nil (doom-project-root)) + (completing-read "Search project: " projects nil t) (user-error "There are no known projects")) default-directory))) (call-interactively @@ -56,8 +55,7 @@ If prefix ARG is set, prompt for a known project to search from." (default-directory (if arg (if-let (projects (projectile-relevant-known-projects)) - (completing-read "Switch to project: " projects - nil t nil nil (doom-project-root)) + (completing-read "Search project: " projects nil t) (user-error "There are no known projects")) default-directory))) (cond ((featurep! :completion ivy)