Disable bottom-up root search if HOME is a project #833

This commit is contained in:
Henrik Lissner 2018-08-26 12:19:47 +02:00
parent 247b219ea1
commit d7e4901bda
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -32,6 +32,19 @@
("less" "css") ("less" "css")
("styl" "css")))) ("styl" "css"))))
;; It breaks projectile's project root resolution if HOME is a project (e.g.
;; it's a git repo). In that case, we disable bottom-up root searching to
;; prevent issues. This makes project resolution a little slower and may cause
;; incorrect project roots in other edge cases.
(let ((default-directory "~"))
(when (cl-find-if #'projectile-file-exists-p
projectile-project-root-files-bottom-up)
(message "HOME appears to be a project. Disabling bottom-up root search.")
(setq projectile-project-root-files
(append projectile-project-root-files-bottom-up
projectile-project-root-files)
projectile-project-root-files-bottom-up nil)))
;; Projectile root-searching functions can cause an infinite loop on TRAMP ;; Projectile root-searching functions can cause an infinite loop on TRAMP
;; connections, so disable them. ;; connections, so disable them.
(defun doom*projectile-locate-dominating-file (orig-fn &rest args) (defun doom*projectile-locate-dominating-file (orig-fn &rest args)