emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c19c5ed 3/8: counsel.el (counsel-git): Switch to action-st


From: Oleh Krehel
Subject: [elpa] master c19c5ed 3/8: counsel.el (counsel-git): Switch to action-style call
Date: Sat, 23 May 2015 11:31:02 +0000

branch: master
commit c19c5ede8bd44bc40d1c207083974c716f93aee6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]