From ed1ad16b53588b04e4ffc20fe56822b9ef80c7c1 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Fri, 29 Jun 2018 06:07:30 +0200 Subject: [PATCH] Let-bind helm-ff-default-directory (#49) * helm-ls-git.el (helm-ls-git-ls): Do it. --- helm-ls-git.el | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/helm-ls-git.el b/helm-ls-git.el index 2aa0100..b080212 100644 --- a/helm-ls-git.el +++ b/helm-ls-git.el @@ -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)