Fix doom-project-find-file on non-project DIRs
This function should be as DWIM as possible.
This commit is contained in:
parent
7b8a2fcff8
commit
ece7b8fdcd
1 changed files with 8 additions and 3 deletions
|
@ -76,11 +76,16 @@ they are absolute."
|
|||
|
||||
;;;###autoload
|
||||
(defun doom-project-find-file (dir)
|
||||
"Fuzzy-find a file under DIR."
|
||||
"Fuzzy-find a file under DIR.
|
||||
|
||||
Will resolve to the nearest project root above DIR. If no project can be found,
|
||||
the search will be rooted from DIR."
|
||||
(unless (file-directory-p dir)
|
||||
(error "Directory %S does not exist" dir))
|
||||
(let ((default-directory dir)
|
||||
projectile-project-root)
|
||||
(let* ((default-directory dir)
|
||||
(projectile-project-root
|
||||
(or (projectile-project-root)
|
||||
dir)))
|
||||
(call-interactively
|
||||
;; Intentionally avoid `helm-projectile-find-file', because it runs
|
||||
;; asynchronously, and thus doesn't see the lexical `default-directory'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue