mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
refactor to use io.read_text
This commit is contained in:
parent
60619f263c
commit
d30fb94c72
1 changed files with 5 additions and 2 deletions
|
@ -101,8 +101,11 @@ class WholeFileFunctionCoder(Coder):
|
|||
# ending an existing block
|
||||
full_path = os.path.abspath(os.path.join(self.root, fname))
|
||||
|
||||
with open(full_path, "r") as f:
|
||||
orig_lines = f.readlines()
|
||||
content = self.io.read_text(full_path)
|
||||
if content is None:
|
||||
orig_lines = []
|
||||
else:
|
||||
orig_lines = content.splitlines()
|
||||
|
||||
show_diff = diffs.diff_partial_update(
|
||||
orig_lines,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue