From 2cc671df757226219ba9e1f513b2a0ef3de1b98b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 1 Dec 2024 09:50:50 -0800 Subject: [PATCH] refactor: update regex to only match ai comments at end of line --- aider/watch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aider/watch.py b/aider/watch.py index e9fe55d76..fe9763639 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -66,8 +66,7 @@ class FileWatcher: """Watches source files for changes and AI comments""" # Compiled regex pattern for AI comments - # make this pattern match at the end of a line ai! - ai_comment_pattern = re.compile(r"(?:#|//) *(ai\b.*|ai|.*\bai!)", re.IGNORECASE) + ai_comment_pattern = re.compile(r"(?:#|//) *.*\bai!? *$", re.IGNORECASE) def __init__(self, coder, gitignores=None, verbose=False): self.coder = coder