fix(lib): doom-project-find-file: fall back to find-file if DIR is empty

Fix: #7949
This commit is contained in:
Henrik Lissner 2024-07-16 11:06:39 -04:00
parent fb0402e89c
commit bd728fd2a8
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -155,9 +155,14 @@ If DIR is not a project, it will be indexed (but not cached)."
((and (bound-and-true-p helm-mode) ((and (bound-and-true-p helm-mode)
(fboundp 'helm-find-files)) (fboundp 'helm-find-files))
(call-interactively #'helm-find-files)) (call-interactively #'helm-find-files))
((when-let ((project-current-directory-override t) ((when-let* ((project-current-directory-override t)
(pr (project-current t dir))) (pr (project-current t dir)))
(project-find-file-in nil nil pr))) (condition-case _
(project-find-file-in nil nil pr)
;; FIX: project.el throws errors if DIR is an empty directory,
;; which is poor UX.
(wrong-type-argument
(call-interactively #'find-file)))))
((call-interactively #'find-file))))) ((call-interactively #'find-file)))))
;;;###autoload ;;;###autoload