branch: elpa/aidermacs
commit 8ad2ec9ece03b07ec2c95824f6991d170698bd7a
Author: Adam Niederer <[email protected]>
Commit: Matthew Zeng <[email protected]>
Don't start aider just to stop it when not running
---
aidermacs.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/aidermacs.el b/aidermacs.el
index 21aa3bf1cf..bdb02bfa4e 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -438,8 +438,10 @@ If the current buffer is already the aidermacs buffer, do
nothing."
(defun aidermacs-exit ()
"Send the command \"/exit\" to the aidermacs buffer."
(interactive)
- (aidermacs--cleanup-temp-buffers)
- (aidermacs--send-command "/exit" t))
+ (when (get-buffer (aidermacs-get-buffer-name))
+ (aidermacs--cleanup-temp-buffers)
+ (when (aidermacs--live-p (aidermacs-get-buffer-name))
+ (aidermacs--send-command "/exit" t))))
(defun aidermacs--process-message-if-multi-line (str)
"Process multi-line chat messages for proper formatting.