Fix #2778: +ivy/projectile-find-file hangs in /

This commit is contained in:
Henrik Lissner 2020-03-27 02:29:22 -04:00
parent e29136dd3e
commit fa23a912de
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -207,8 +207,8 @@ If ARG (universal argument), open selection in other-window."
;;;###autoload
(defun +ivy/projectile-find-file ()
"A more sensible `counsel-projectile-find-file', which will revert to
`counsel-find-file' if invoked from $HOME, `counsel-file-jump' if invoked from a
non-project, `projectile-find-file' if in a big project (more than
`counsel-find-file' if invoked from $HOME or /, `counsel-file-jump' if invoked
from a non-project, `projectile-find-file' if in a big project (more than
`ivy-sort-max-size' files), or `counsel-projectile-find-file' otherwise.
The point of this is to avoid Emacs locking up indexing massive file trees."
@ -219,6 +219,7 @@ The point of this is to avoid Emacs locking up indexing massive file trees."
(let ((this-command 'counsel-find-file))
(call-interactively
(cond ((or (file-equal-p default-directory "~")
(file-equal-p default-directory "/")
(when-let (proot (doom-project-root))
(file-equal-p proot "~")))
#'counsel-find-file)