branch: master
commit c19c5ede8bd44bc40d1c207083974c716f93aee6
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-git): Switch to action-style call
This allows "C-M-n" and "C-M-p" to be used.
Re #114
---
counsel.el | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/counsel.el b/counsel.el
index 2fce67f..fb831ae 100644
--- a/counsel.el
+++ b/counsel.el
@@ -167,16 +167,15 @@
(defun counsel-git ()
"Find file in the current Git repository."
(interactive)
- (let* ((default-directory (locate-dominating-file
- default-directory ".git"))
- (cands (split-string
- (shell-command-to-string
- "git ls-files --full-name --")
- "\n"
- t))
- (file (ivy-read "Find file: " cands)))
- (when file
- (find-file file))))
+ (ivy-read "Find file: "
+ (let ((default-directory (locate-dominating-file
+ default-directory ".git")))
+ (split-string
+ (shell-command-to-string
+ "git ls-files --full-name --")
+ "\n"
+ t))
+ :action (lambda () (find-file ivy--current))))
(defvar counsel--git-grep-dir nil
"Store the base git directory.")