diff --git a/init.el b/init.el index 828084f..ea98d3d 100644 --- a/init.el +++ b/init.el @@ -1715,7 +1715,15 @@ COMMAND and COMINT are like `compile'." (defun my/project-try-dotfile (dir) (if-let (root (locate-dominating-file dir my/project-root-marker)) (list 'vc nil root))) - (add-hook 'project-find-functions #'my/project-try-dotfile)) + (add-hook 'project-find-functions #'my/project-try-dotfile) + ;; `project-try-vc' causes consult file previews to break! + (defun my/project-try-vc-safe (dir) + (ignore-error file-error + (project-try-vc dir))) + (let ((cur-val (default-toplevel-value 'project-find-functions))) + (setq-default project-find-functions + (cl-nsubstitute 'my/project-try-vc-safe 'project-try-vc + cur-val)))) ;; comint (use-package comint