From eba8320334f06fe39dee88fb32ed10d44b768b65 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Mon, 5 Jun 2023 09:10:03 +0000 Subject: [PATCH] Support recompile (g key) to repeat the search This only simulates the original way the search is done. E.g., we can't use --null here, because the output will now be parsed by compilation-mode, not us. --- helm-git-grep.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helm-git-grep.el b/helm-git-grep.el index c9a66af..99a5c84 100644 --- a/helm-git-grep.el +++ b/helm-git-grep.el @@ -346,6 +346,10 @@ newline return an empty string." (buffer-substring (point) (point-max))))) (setq default-directory default-dir) (helm-git-grep-mode) + (setq-local compilation-directory default-dir) + (setq-local compile-command (combine-and-quote-strings + (cons "git" (remove "--null" (helm-git-grep-args))))) + (setq-local compilation-arguments (list compile-command 'helm-git-grep-mode)) (pop-to-buffer buf))) (message "Helm Git Grep Results saved in `%s' buffer" buf)))