Skip to content

Commit

Permalink
Let-bind helm-ff-default-directory (#49)
Browse files Browse the repository at this point in the history
* helm-ls-git.el (helm-ls-git-ls): Do it.
  • Loading branch information
Thierry Volpiatto committed Jun 29, 2018
1 parent ceeac5c commit ed1ad16
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions helm-ls-git.el
Original file line number Diff line number Diff line change
Expand Up @@ -687,20 +687,23 @@ Do nothing when `helm-source-ls-git-buffers' is not member of
;;;###autoload
(defun helm-ls-git-ls (&optional arg)
(interactive "p")
(when (and arg (helm-ls-git-not-inside-git-repo))
(error "Not inside a Git repository"))
(unless (cl-loop for s in helm-ls-git-default-sources
always (symbol-value s))
(setq helm-source-ls-git-status
(helm-ls-git-build-git-status-source)
helm-source-ls-git
(helm-ls-git-build-ls-git-source)
helm-source-ls-git-buffers
(helm-ls-git-build-buffers-source)))
(helm-set-local-variable 'helm-ls-git--current-branch (helm-ls-git--branch))
(helm :sources helm-ls-git-default-sources
:ff-transformer-show-only-basename nil
:buffer "*helm lsgit*"))
(let ((helm-ff-default-directory
(or helm-ff-default-directory
default-directory)))
(when (and arg (helm-ls-git-not-inside-git-repo))
(error "Not inside a Git repository"))
(unless (cl-loop for s in helm-ls-git-default-sources
always (symbol-value s))
(setq helm-source-ls-git-status
(helm-ls-git-build-git-status-source)
helm-source-ls-git
(helm-ls-git-build-ls-git-source)
helm-source-ls-git-buffers
(helm-ls-git-build-buffers-source)))
(helm-set-local-variable 'helm-ls-git--current-branch (helm-ls-git--branch))
(helm :sources helm-ls-git-default-sources
:ff-transformer-show-only-basename nil
:buffer "*helm lsgit*")))


(provide 'helm-ls-git)
Expand Down

0 comments on commit ed1ad16

Please sign in to comment.