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.
This commit is contained in:
Henrik Lissner 2020-05-26 14:02:06 -04:00
parent 8d75d72eb0
commit 77a4e8f8a7
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 4 additions and 8 deletions

View file

@ -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)