mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-14 00:25:00 +00:00
Merge branch 'main' into triple-backticks
This commit is contained in:
commit
2b8717bdb6
5 changed files with 41 additions and 16 deletions
|
@ -1 +1 @@
|
|||
__version__ = "0.7.0"
|
||||
__version__ = "0.7.1"
|
||||
|
|
|
@ -44,7 +44,7 @@ class WholeFileCoder(Coder):
|
|||
full_path = (Path(self.root) / fname).absolute()
|
||||
|
||||
if mode == "diff" and full_path.exists():
|
||||
orig_lines = full_path.read_text().splitlines()
|
||||
orig_lines = full_path.read_text().splitlines(keepends=True)
|
||||
|
||||
show_diff = diffs.diff_partial_update(
|
||||
orig_lines,
|
||||
|
@ -99,7 +99,7 @@ class WholeFileCoder(Coder):
|
|||
full_path = (Path(self.root) / fname).absolute()
|
||||
|
||||
if mode == "diff" and full_path.exists():
|
||||
orig_lines = full_path.read_text().splitlines()
|
||||
orig_lines = full_path.read_text().splitlines(keepends=True)
|
||||
|
||||
show_diff = diffs.diff_partial_update(
|
||||
orig_lines,
|
||||
|
|
|
@ -14,7 +14,8 @@ Once you understand the request you MUST:
|
|||
3. If changes are needed, output a copy of each file that needs changes.
|
||||
"""
|
||||
|
||||
system_reminder = """To return code you MUST use this *file listing* format:
|
||||
system_reminder = """To suggest changes to a file you MUST return the entire content of the updated file.
|
||||
You MUST use this *file listing* format:
|
||||
|
||||
path/to/filename.js
|
||||
{fence}javascript
|
||||
|
|
|
@ -33,6 +33,13 @@ def create_progress_bar(percentage):
|
|||
return bar
|
||||
|
||||
|
||||
def assert_newlines(lines):
|
||||
if not lines:
|
||||
return
|
||||
for line in lines:
|
||||
assert line and line[-1] == "\n", line
|
||||
|
||||
|
||||
def diff_partial_update(lines_orig, lines_updated, final=False, fname=None):
|
||||
"""
|
||||
Given only the first part of an updated file, show the diff while
|
||||
|
@ -43,6 +50,9 @@ def diff_partial_update(lines_orig, lines_updated, final=False, fname=None):
|
|||
# dump(lines_orig)
|
||||
# dump(lines_updated)
|
||||
|
||||
assert_newlines(lines_orig)
|
||||
assert_newlines(lines_orig)
|
||||
|
||||
num_orig_lines = len(lines_orig)
|
||||
|
||||
if final:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue