Try counsel-file-jump before project-find-file-in
The former is more reliable (and faster, with the fd/rg hack in the next commit). Also (hopefully) fixes the "cl-no-applicable-method: No applicable method: project-roots" error emitted when project-find-file-in fails to identify the target as a project root.
This commit is contained in:
parent
3ec66b7c1c
commit
29e851da27
1 changed files with 5 additions and 3 deletions
|
@ -110,14 +110,16 @@ If DIR is not a project, it will be indexed (but not cached)."
|
|||
(setq projectile-enable-caching nil))
|
||||
(call-interactively
|
||||
;; Intentionally avoid `helm-projectile-find-file', because it runs
|
||||
;; asynchronously, and thus doesn't see the lexical `default-directory'
|
||||
;; asynchronously, and thus doesn't see the lexical
|
||||
;; `default-directory'
|
||||
(if (doom-module-p :completion 'ivy)
|
||||
#'counsel-projectile-find-file
|
||||
#'projectile-find-file)))
|
||||
((fboundp 'project-find-file-in) ; emacs 26.1+ only
|
||||
(project-find-file-in nil (list default-directory) nil))
|
||||
((fboundp 'counsel-file-jump) ; ivy only
|
||||
(call-interactively #'counsel-file-jump))
|
||||
((and (fboundp 'project-find-file-in) ; emacs 26.1+ only
|
||||
(project-current))
|
||||
(project-find-file-in nil (list default-directory) nil))
|
||||
((fboundp 'helm-find-files)
|
||||
(call-interactively #'helm-find-files))
|
||||
((call-interactively #'find-file)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue