tweak(lib): doom-project-find-file: use transient project

If DIR is not a project and does not have root markers, create a
transient project instead. This ensures that `project-find-file-in`, and
by extension vertico, is still used in non-project directories instead
of falling back to `find-file`

Ref: 1b0af3bfc7
This commit is contained in:
132ikl 2024-07-06 20:16:59 -04:00 committed by GitHub
parent 1cc83dce35
commit d7075b2420
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,11 +152,12 @@ If DIR is not a project, it will be indexed (but not cached)."
((and (bound-and-true-p ivy-mode)
(fboundp 'counsel-file-jump))
(call-interactively #'counsel-file-jump))
((when-let ((pr (project-current nil dir)))
(project-find-file-in nil nil pr)))
((and (bound-and-true-p helm-mode)
(fboundp 'helm-find-files))
(call-interactively #'helm-find-files))
((when-let ((project-current-directory-override t)
(pr (project-current t dir)))
(project-find-file-in nil nil pr)))
((call-interactively #'find-file)))))
;;;###autoload