mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
ssh
This commit is contained in:
parent
9e64e7bb9d
commit
73c4efea94
1 changed files with 0 additions and 8 deletions
|
@ -70,7 +70,6 @@ def perfect_replace(whole_lines, part_lines, replace_lines):
|
|||
|
||||
for i in range(len(whole_lines) - part_len + 1):
|
||||
whole_tup = tuple(whole_lines[i : i + part_len])
|
||||
dump(part_tup, whole_tup)
|
||||
if part_tup == whole_tup:
|
||||
res = whole_lines[:i] + replace_lines + whole_lines[i + part_len :]
|
||||
return "".join(res)
|
||||
|
@ -172,16 +171,11 @@ def replace_part_with_missing_leading_whitespace(whole_lines, part_lines, replac
|
|||
len(p) - len(p.lstrip()) for p in replace_lines if p.strip()
|
||||
]
|
||||
|
||||
dump(leading)
|
||||
|
||||
if leading and min(leading):
|
||||
num_leading = min(leading)
|
||||
part_lines = [p[num_leading:] if p.strip() else p for p in part_lines]
|
||||
replace_lines = [p[num_leading:] if p.strip() else p for p in replace_lines]
|
||||
|
||||
dump(part_lines)
|
||||
dump(replace_lines)
|
||||
|
||||
# can we find an exact match not including the leading whitespace
|
||||
num_part_lines = len(part_lines)
|
||||
|
||||
|
@ -190,8 +184,6 @@ def replace_part_with_missing_leading_whitespace(whole_lines, part_lines, replac
|
|||
whole_lines[i : i + num_part_lines], part_lines
|
||||
)
|
||||
|
||||
dump(add_leading)
|
||||
|
||||
if add_leading is None:
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue