From 4af3063f3094419c3ea280add1efba590ac80bf9 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 5 Sep 2024 06:18:19 -0600 Subject: [PATCH] Close diff when PR is submitted --- emacs/.emacs.d/config/init-git.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs/.emacs.d/config/init-git.el b/emacs/.emacs.d/config/init-git.el index f022169..ccc8ea2 100644 --- a/emacs/.emacs.d/config/init-git.el +++ b/emacs/.emacs.d/config/init-git.el @@ -85,7 +85,11 @@ Does not work on already-created pull requests." (let ((target forge--buffer-base-branch) (source forge--buffer-head-branch)) (magit-diff-range (format "%s..%s" target source)))) + (defun forge--submit-create-pullreq-after-advice (&rest args) + (when-let ((buf (magit-get-mode-buffer 'magit-diff-mode))) + (quit-window nil (get-buffer-window buf)))) (add-hook 'forge-create-pullreq-hook #'forge-diff-for-pr) + (advice-add 'forge--submit-create-pullreq :after #'forge--submit-create-pullreq-after-advice) :custom (forge-owned-accounts '((jdormit . (remote-name "jdormit")))) :general