branch: elpa/aidermacs
commit 8b295c8f95a8b1fb319f7212d34841ab7611229c
Author: Mingde (Matthew) Zeng <matthew...@posteo.net>
Commit: Mingde (Matthew) Zeng <matthew...@posteo.net>

    Use aidermacs-prompt-regexp
---
 aidermacs-backend-comint.el | 4 ++--
 aidermacs-backend-vterm.el  | 2 +-
 aidermacs.el                | 4 ++++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/aidermacs-backend-comint.el b/aidermacs-backend-comint.el
index d34ba64b8b..e85f385d2d 100644
--- a/aidermacs-backend-comint.el
+++ b/aidermacs-backend-comint.el
@@ -110,7 +110,7 @@ that was matched at the start of the current syntax block.")
     (setq aidermacs--comint-output-temp
           (concat aidermacs--comint-output-temp (substring-no-properties 
output)))
     ;; Check if the output contains a prompt
-    (when (string-match-p "\n[^[:space:]]*>[[:space:]]$" 
aidermacs--comint-output-temp)
+    (when (string-match-p aidermacs-prompt-regexp 
aidermacs--comint-output-temp)
       (aidermacs--store-output aidermacs--comint-output-temp)
       ;; Check if any files were edited and show ediff if needed
       (let ((edited-files (aidermacs--detect-edited-files)))
@@ -288,7 +288,7 @@ BUFFER-NAME is the name for the aidermacs buffer."
       (apply #'make-comint-in-buffer "aidermacs" buffer-name program nil args)
       (with-current-buffer buffer-name
         (comint-mode)
-        (setq-local comint-prompt-regexp "[^[:space:]]*>[[:space:]]$")
+        (setq-local comint-prompt-regexp aidermacs-prompt-regexp)
         (setq-local comint-input-sender 'aidermacs-input-sender)
         (setq aidermacs--syntax-work-buffer
               (get-buffer-create (concat " *aidermacs-syntax" buffer-name)))
diff --git a/aidermacs-backend-vterm.el b/aidermacs-backend-vterm.el
index 39ff7f7858..868a463e0c 100644
--- a/aidermacs-backend-vterm.el
+++ b/aidermacs-backend-vterm.el
@@ -83,7 +83,7 @@ If the finish sequence is detected, store the output via
              (last-check (or aidermacs--vterm-last-check-point start-point))
              (should-check (> prompt-point last-check))
              ;; Simplified pattern that just looks for a shell prompt
-             (expected "^[^[:space:]]*>[[:space:]]"))
+             (expected aidermacs-prompt-regexp))
 
         ;; Update the last check point
         (setq aidermacs--vterm-last-check-point prompt-point)
diff --git a/aidermacs.el b/aidermacs.el
index cdf8f90e1c..acd1cdcdad 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -99,6 +99,9 @@ This is the file name without path."
   :type 'string
   :group 'aidermacs)
 
+(defvar aidermacs-prompt-regexp "^[^[:space:]<]*>[[:space:]]$"
+  "Regexp to match Aider's command prompt.")
+
 (defvar-local aidermacs-read-string-history nil
   "History list for aidermacs read string inputs.")
 
@@ -328,6 +331,7 @@ and syntax highlighting to match the original file."
 This is called when all ediff sessions are complete.
 Kills all pre-edit buffers that were created to store original file content."
   (interactive)
+  (message "Cleaning up")
   (with-current-buffer (get-buffer (aidermacs-get-buffer-name))
     ;; Clean up buffers in the tracking list
     (dolist (file-pair aidermacs--pre-edit-file-buffers)

Reply via email to