Fix #3960: make prefix arg consistent in +default/search-project

Is documented to include ignored/hidden files in the search result, but
would prompt for another project instead.
This commit is contained in:
Henrik Lissner 2020-09-19 14:38:53 -04:00
parent e2658052af
commit a6dc6275f8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -33,13 +33,13 @@ If a selection is active, pre-fill the prompt with it."
;;;###autoload
(defun +default/search-project (&optional arg)
"Conduct a text search in the current project root.
If prefix ARG is set, prompt for a known project to search from."
If prefix ARG is set, include ignored/hidden files."
(interactive "P")
(let* ((projectile-project-root nil)
(disabled-command-function nil)
(current-prefix-arg nil)
(current-prefix-arg (unless (eq arg 'other) arg))
(default-directory
(if arg
(if (eq arg 'other)
(if-let (projects (projectile-relevant-known-projects))
(completing-read "Search project: " projects nil t)
(user-error "There are no known projects"))