From 0bef52ae7d36ec502a55e73ac319340b350d5812 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 16 Dec 2024 12:27:19 -0800 Subject: [PATCH] fix: Only show AI comment help once per file add --- aider/watch.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/aider/watch.py b/aider/watch.py index 9a1ac33a3..016581870 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -145,6 +145,7 @@ class FileWatcher: """Get any detected file changes""" has_action = None + added = False for fname in self.changed_files: _, _, action = self.get_ai_comments(fname) if action in ("!", "?"): @@ -156,14 +157,16 @@ class FileWatcher: self.analytics.event("ai-comments file-add") self.coder.abs_fnames.add(fname) rel_fname = self.coder.get_rel_fname(fname) + if not added: + self.io.tool_output() + added = True self.io.tool_output(f"Added {rel_fname} to the chat") - if not has_action: - self.io.tool_output( - "Use AI! to request changes or AI? to ask questions about the code" - ) - self.io.tool_output() if not has_action: + if added: + self.io.tool_output( + "End your comment with AI! to request changes or AI? to ask questions" + ) return "" if self.analytics: