branch: elpa/aidermacs
commit 6b805bdaa11c754e5bbfee7a3cc39fbae835b39b
Author: OverbearingPearl <[email protected]>
Commit: OverbearingPearl <[email protected]>
Fix file tracking and edit preparation logic
- Move `aidermacs--prepare-for-code-edit` call to only trigger when
explicitly adding files via "Applied edit" message
- Remove redundant edit preparation when detecting files from chat output
- Maintain consistent behavior between different file addition paths
Resolves #204
---
aidermacs-output.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/aidermacs-output.el b/aidermacs-output.el
index 82b563c224..8b35088c2d 100644
--- a/aidermacs-output.el
+++ b/aidermacs-output.el
@@ -255,7 +255,8 @@ Only adds the hook if it's not already present."
;; Applied edit to <filename>
((string-match "Applied edit to \\(\\./\\)?\\(.+\\)" line)
(when-let* ((file (match-string 2 line)))
- (add-to-list 'aidermacs--tracked-files file)))
+ (add-to-list 'aidermacs--tracked-files file)
+ (aidermacs--prepare-for-code-edit)))
;; Added <filename> to the chat.
((string-match "Added \\(\\./\\)?\\(.+\\) to the chat" line)
@@ -295,8 +296,7 @@ Only adds the hook if it's not already present."
(not (string-match-p "^[[:space:]]*$" last-line))
(or (string-match-p "\\.[a-zA-Z0-9]+$" last-line)
(string-match-p "[/\\]" last-line)))
- (add-to-list 'aidermacs--tracked-files last-line)
- (aidermacs--prepare-for-code-edit)))
+ (add-to-list 'aidermacs--tracked-files last-line)))
;; <file> is already in the chat as an editable file
((string-match "\\(\\./\\)?\\(.+\\) is already in the chat as an
editable file" line)