mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
refactor: move clipboard context functionality to commands.py
This commit is contained in:
parent
402940a215
commit
623770e24b
5 changed files with 54 additions and 52 deletions
16
aider/io.py
16
aider/io.py
|
@ -176,6 +176,7 @@ class AutoCompleter(Completer):
|
|||
class InputOutput:
|
||||
num_error_outputs = 0
|
||||
num_user_asks = 0
|
||||
clipboard_watcher = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -470,8 +471,11 @@ class InputOutput:
|
|||
self.placeholder = None
|
||||
|
||||
self.interrupted = False
|
||||
if not multiline_input and self.file_watcher:
|
||||
self.file_watcher.start()
|
||||
if not multiline_input:
|
||||
if self.file_watcher:
|
||||
self.file_watcher.start()
|
||||
if self.clipboard_watcher:
|
||||
self.clipboard_watcher.start()
|
||||
|
||||
line = self.prompt_session.prompt(
|
||||
show,
|
||||
|
@ -487,8 +491,10 @@ class InputOutput:
|
|||
|
||||
# Check if we were interrupted by a file change
|
||||
if self.interrupted:
|
||||
cmd = self.file_watcher.process_changes()
|
||||
return cmd
|
||||
line = line or ""
|
||||
if self.file_watcher:
|
||||
cmd = self.file_watcher.process_changes()
|
||||
return cmd
|
||||
|
||||
except EOFError:
|
||||
return ""
|
||||
|
@ -504,6 +510,8 @@ class InputOutput:
|
|||
finally:
|
||||
if self.file_watcher:
|
||||
self.file_watcher.stop()
|
||||
if self.clipboard_watcher:
|
||||
self.clipboard_watcher.stop()
|
||||
|
||||
if line.strip("\r\n") and not multiline_input:
|
||||
stripped = line.strip("\r\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue