Skip to content

Commit

Permalink
Default counsel-ag-project to default-directory if not in a project
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed May 26, 2017
1 parent fb98e41 commit b48dd23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lisp/init-ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))


Expand Down

0 comments on commit b48dd23

Please sign in to comment.