mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
feat: add file change monitoring with gitignore support
This commit is contained in:
parent
da7bb312c2
commit
6a1754aa6a
1 changed files with 4 additions and 2 deletions
|
@ -366,10 +366,11 @@ class InputOutput:
|
||||||
self.changed_files = None
|
self.changed_files = None
|
||||||
stop_event = threading.Event()
|
stop_event = threading.Event()
|
||||||
|
|
||||||
# Define the watcher thread function
|
|
||||||
def watch_files():
|
def watch_files():
|
||||||
|
gitignore = Path(root) / ".gitignore"
|
||||||
try:
|
try:
|
||||||
for changed in watch_source_files(root, stop_event=stop_event):
|
for changed in watch_source_files(root, stop_event=stop_event):
|
||||||
|
dump(changed)
|
||||||
if changed:
|
if changed:
|
||||||
self.changed_files = list(changed)[0] # Take the first changed file
|
self.changed_files = list(changed)[0] # Take the first changed file
|
||||||
self.interrupt_input()
|
self.interrupt_input()
|
||||||
|
@ -437,11 +438,12 @@ class InputOutput:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
line = input(show)
|
line = input(show)
|
||||||
except (EOFError, KeyboardInterrupt):
|
except EOFError:
|
||||||
# Check if we were interrupted by a file change
|
# Check if we were interrupted by a file change
|
||||||
if self.changed_files:
|
if self.changed_files:
|
||||||
changed = self.changed_files
|
changed = self.changed_files
|
||||||
self.changed_files = None
|
self.changed_files = None
|
||||||
|
dump(changed)
|
||||||
return f"/add {changed}" # Return an edit command for the changed file
|
return f"/add {changed}" # Return an edit command for the changed file
|
||||||
return ""
|
return ""
|
||||||
except UnicodeEncodeError as err:
|
except UnicodeEncodeError as err:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue