From 9f1b8347f599f67be33242e249b51ee8095ce5d1 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 25 Oct 2024 15:58:41 -0700 Subject: [PATCH] refactor: simplify regex pattern for matching AI comments --- aider/watch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aider/watch.py b/aider/watch.py index 8f4f74098..511f6fc7a 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -113,8 +113,7 @@ def watch_source_files( with open(path_abs, encoding=encoding, errors="ignore") as f: content = f.read() - # ai: don't just match at start of line - res = bool(re.search(r"(?:^|\n)(?:#|//) *ai\b", content, re.IGNORECASE)) + res = bool(re.search(r"(?:#|//) *ai\b", content, re.IGNORECASE)) if VERBOSE: dump(res) return res except (IOError, UnicodeDecodeError) as err: