Skip to content

Commit 5d64eb2

Browse files
author
Thierry Volpiatto
committed
Fix actions, require helm-types.
* helm-ls-git.el (helm-ls-git-actions-list): Take now one arg actions. (helm-ls-git-source): Use it.
1 parent c05f0ea commit 5d64eb2

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.elc
22
TAGS
3+
ID

helm-ls-git.el

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
(require 'vc)
2424
(require 'vc-git)
2525
(require 'helm-files)
26+
(require 'helm-types)
2627

2728
(defvaralias 'helm-c-source-ls-git 'helm-source-ls-git)
2829
(make-obsolete-variable 'helm-c-source-ls-git 'helm-source-ls-git "1.5.1")
@@ -196,16 +197,19 @@ The color of matched items can be customized in your .gitconfig."
196197
(buffer-substring-no-properties (goto-char (point-min))
197198
(line-end-position)))))
198199

199-
(defun helm-ls-git-actions-list ()
200-
(let ((actions (helm-actions-from-type-file)))
201-
(helm-append-at-nth
202-
(helm-interpret-value actions nil 'ignorefn)
203-
(helm-make-actions "Git grep files (`C-u' only files with ext, `C-u C-u' all)"
204-
'helm-ls-git-grep
205-
"Gid" 'helm-ff-gid
206-
"Search in Git log (C-u show patch)"
207-
'helm-ls-git-search-log)
208-
3)))
200+
(defun helm-ls-git-actions-list (&optional actions)
201+
(helm-append-at-nth
202+
actions
203+
(helm-make-actions "Git status"
204+
(lambda (_candidate)
205+
(funcall helm-ls-git-status-command
206+
(helm-default-directory)))
207+
"Git grep files (`C-u' only files with ext, `C-u C-u' all)"
208+
'helm-ls-git-grep
209+
"Gid" 'helm-ff-gid
210+
"Search in Git log (C-u show patch)"
211+
'helm-ls-git-search-log)
212+
1))
209213

210214
(defun helm-ls-git-match-part (candidate)
211215
(if (with-helm-buffer helm-ff-transformer-show-only-basename)
@@ -223,7 +227,7 @@ The color of matched items can be customized in your .gitconfig."
223227
(candidate-transformer :initform '(helm-ls-git-transformer
224228
helm-ls-git-sort-fn))
225229
(action-transformer :initform 'helm-transform-file-load-el)
226-
(action :initform (helm-ls-git-actions-list))))
230+
(action :initform (helm-ls-git-actions-list helm-type-file-actions))))
227231

228232
;;;###autoload
229233
(defclass helm-ls-git-status-source (helm-source-in-buffer)

0 commit comments

Comments
 (0)