From 6a1754aa6a381dbd23195f51814cfa2ead1626ad Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 25 Oct 2024 12:56:19 -0700 Subject: [PATCH] feat: add file change monitoring with gitignore support --- aider/io.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aider/io.py b/aider/io.py index 833de9e59..9b36a974f 100644 --- a/aider/io.py +++ b/aider/io.py @@ -366,10 +366,11 @@ class InputOutput: self.changed_files = None stop_event = threading.Event() - # Define the watcher thread function def watch_files(): + gitignore = Path(root) / ".gitignore" try: for changed in watch_source_files(root, stop_event=stop_event): + dump(changed) if changed: self.changed_files = list(changed)[0] # Take the first changed file self.interrupt_input() @@ -437,11 +438,12 @@ class InputOutput: ) else: line = input(show) - except (EOFError, KeyboardInterrupt): + except EOFError: # Check if we were interrupted by a file change if self.changed_files: changed = self.changed_files self.changed_files = None + dump(changed) return f"/add {changed}" # Return an edit command for the changed file return "" except UnicodeEncodeError as err: