From 96086f12c60ef7b30dab6faf57d8a3ac0d7701d2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 11 Dec 2024 20:16:09 -0800 Subject: [PATCH] fix: Correct ai comment regex to match ai? and ai! --- aider/watch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/watch.py b/aider/watch.py index 4d0f21edd..156033f40 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -83,7 +83,7 @@ class FileWatcher: """Watches source files for changes and AI comments""" # Compiled regex pattern for AI comments - ai_comment_pattern = re.compile(r"(?:#|//|--) *(ai\b.*|ai\b.*|.*\bai!?) *$", re.IGNORECASE) + ai_comment_pattern = re.compile(r"(?:#|//|--) *(ai\b.*|ai\b.*|.*\bai[?!]?) *$", re.IGNORECASE) def __init__(self, coder, gitignores=None, verbose=False, analytics=None): self.coder = coder