completion/ivy: general refactor

This commit is contained in:
Henrik Lissner 2019-12-20 14:03:35 -05:00
parent 52bf238b2f
commit 8a080e037c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 59 additions and 55 deletions

View file

@ -223,19 +223,23 @@ non-project, `projectile-find-file' if in a big project (more than
The point of this is to avoid Emacs locking up indexing massive file trees."
(interactive)
(call-interactively
(cond ((or (file-equal-p default-directory "~")
(when-let (proot (doom-project-root))
(file-equal-p proot "~")))
#'counsel-find-file)
;; Spoof the command so that ivy/counsel will display the (well fleshed-out)
;; actions list for `counsel-find-file' on C-o. The actions list for the other
;; commands aren't as well configured or are empty.
(let ((this-command 'counsel-find-file))
(call-interactively
(cond ((or (file-equal-p default-directory "~")
(when-let (proot (doom-project-root))
(file-equal-p proot "~")))
#'counsel-find-file)
((doom-project-p)
(let ((files (projectile-current-project-files)))
(if (<= (length files) ivy-sort-max-size)
#'counsel-projectile-find-file
#'projectile-find-file)))
((doom-project-p)
(let ((files (projectile-current-project-files)))
(if (<= (length files) ivy-sort-max-size)
#'counsel-projectile-find-file
#'projectile-find-file)))
(#'counsel-file-jump))))
(#'counsel-file-jump)))))
;;;###autoload
(cl-defun +ivy-file-search (&key query in all-files (recursive t))