From 9db3929117e025b05a2db6e1e1c5c8cb43a2458b Mon Sep 17 00:00:00 2001 From: Lucas Sta Maria Date: Wed, 27 Aug 2025 17:17:36 +0800 Subject: [PATCH] fix: confirm review submission and kill buffer on submit --- ghpr-review.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ghpr-review.el b/ghpr-review.el index 82f37e9..5961798 100644 --- a/ghpr-review.el +++ b/ghpr-review.el @@ -393,13 +393,17 @@ Collects review body and inline comments from current buffer." (or (not body) (string-empty-p (string-trim body)))) (error "Review body is required for %s events" event)) - (unless (ghpr--create-review ghpr--review-repo-name - pr-number - commit-sha - (or body "") - event - api-comments) - (message "Failed to submit review")))) + (when (yes-or-no-p (format "Submit review (%s)? " event)) + (if (ghpr--create-review ghpr--review-repo-name + pr-number + commit-sha + (or body "") + event + api-comments) + (progn + (message "Review submitted successfully") + (kill-buffer (current-buffer))) + (message "Failed to submit review"))))) (defun ghpr-review-comment () "Submit review comments with COMMENT event."