From 47296e4294030b32147b2dbe8d6eec3265733bfe Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 25 Oct 2024 16:21:21 -0700 Subject: [PATCH] fix: correct regex pattern for AI comment detection --- aider/watch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/watch.py b/aider/watch.py index 0a89ffd9a..994e55277 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -145,7 +145,7 @@ def get_ai_comment(filepath, encoding="utf-8"): try: with open(filepath, encoding=encoding, errors="ignore") as f: for line in f:#ai - if match := re.search(r"(?:#|//) *ai\b?(.*)", line, re.IGNORECASE): + if match := re.search(r"(?:#|//) *ai(\b.*)?", line, re.IGNORECASE): comment = match.group(1).strip() if comment: comments.append(comment)