Skip to content

Commit

Permalink
reset chat in copilot-chat-ask-and-insert when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
chep committed Sep 6, 2024
1 parent 6c3abb0 commit 2534ef6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions copilot-chat.el
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
(defun copilot-chat-ask-and-insert()
"Send to Copilot a custom prompt and insert answer in current buffer at point."
(interactive)
(unless (copilot-chat--ready-p)
(copilot-chat-reset))
(let* ((prompt (read-from-minibuffer "Copilot prompt: "))
(current-buf (current-buffer)))
(copilot-chat--ask prompt (lambda (content)
Expand Down

0 comments on commit 2534ef6

Please sign in to comment.