diff --git a/lisp/init-ivy.el b/lisp/init-ivy.el index 822bac444e..5453b6bb08 100644 --- a/lisp/init-ivy.el +++ b/lisp/init-ivy.el @@ -43,7 +43,9 @@ (defun sanityinc/counsel-ag-project (initial-input) "Search using `counsel-ag' from the project root for INITIAL-INPUT." (interactive (list (thing-at-point 'symbol))) - (counsel-ag initial-input (projectile-project-root))) + (counsel-ag initial-input (condition-case err + (projectile-project-root) + (error default-directory)))) (global-set-key (kbd "M-?") 'sanityinc/counsel-ag-project)))