mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
Move the fname inside the unified diff block
This commit is contained in:
parent
5043397848
commit
b5a92896ab
2 changed files with 4 additions and 3 deletions
|
@ -78,8 +78,6 @@ class WholeFileFunctionCoder(Coder):
|
||||||
if not content:
|
if not content:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
res += path + ":\n"
|
|
||||||
|
|
||||||
this_final = (i < len(files) - 1) or final
|
this_final = (i < len(files) - 1) or final
|
||||||
res += self.live_diffs(path, content, this_final)
|
res += self.live_diffs(path, content, this_final)
|
||||||
|
|
||||||
|
@ -98,6 +96,7 @@ class WholeFileFunctionCoder(Coder):
|
||||||
orig_lines,
|
orig_lines,
|
||||||
lines,
|
lines,
|
||||||
final,
|
final,
|
||||||
|
fname=fname,
|
||||||
).splitlines()
|
).splitlines()
|
||||||
|
|
||||||
return "\n".join(show_diff)
|
return "\n".join(show_diff)
|
||||||
|
|
|
@ -33,7 +33,7 @@ def create_progress_bar(percentage):
|
||||||
return bar
|
return bar
|
||||||
|
|
||||||
|
|
||||||
def diff_partial_update(lines_orig, lines_updated, final=False):
|
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
|
Given only the first part of an updated file, show the diff while
|
||||||
ignoring the block of "deleted" lines that are past the end of the
|
ignoring the block of "deleted" lines that are past the end of the
|
||||||
|
@ -72,6 +72,8 @@ def diff_partial_update(lines_orig, lines_updated, final=False):
|
||||||
diff += "\n"
|
diff += "\n"
|
||||||
|
|
||||||
show = "```diff\n"
|
show = "```diff\n"
|
||||||
|
if fname:
|
||||||
|
show += f"@@ {fname}\n"
|
||||||
if not final:
|
if not final:
|
||||||
show += bar
|
show += bar
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue