From 1261a335f4e28abf62d3b6a7e44fbe23529c0563 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 25 Oct 2024 13:17:53 -0700 Subject: [PATCH] refactor: improve file change handling in input loop --- aider/io.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aider/io.py b/aider/io.py index 3dfa222da..e30f09ec6 100644 --- a/aider/io.py +++ b/aider/io.py @@ -373,9 +373,8 @@ class InputOutput: for changed in watch_source_files( root, stop_event=stop_event, gitignores=gitignore ): - dump(changed) if changed: - self.changed_files = list(changed)[0] # Take the first changed file + self.changed_files = list(changed) self.interrupt_input() break except Exception as e: @@ -384,7 +383,6 @@ class InputOutput: # Start the watcher thread watcher = threading.Thread(target=watch_files, daemon=True) watcher.start() - dump(watcher) rel_fnames = list(rel_fnames) show = "" @@ -441,11 +439,13 @@ class InputOutput: ) else: line = input(show) + + dump(line)# # Check if we were interrupted by a file change if self.changed_files: - changed = self.changed_files + changed = ' '.join(self.changed_files) self.changed_files = None - dump(changed) + return f"/add {changed}" # Return an edit command for the changed file except EOFError: return ""