mirror of
https://github.com/Aider-AI/aider
synced 2026-05-15 03:16:35 +02:00
wip
This commit is contained in:
@@ -355,7 +355,10 @@ class Coder:
|
||||
|
||||
return self.send_new_user_message(inp)
|
||||
|
||||
num_ticks = 4
|
||||
num_ticks = 5
|
||||
|
||||
def get_fence_ticks(self):
|
||||
return "`" * self.num_ticks
|
||||
|
||||
def fmt_system_reminder(self):
|
||||
prompt = self.gpt_prompts.system_reminder
|
||||
@@ -364,18 +367,16 @@ class Coder:
|
||||
explain = f"""
|
||||
You *MUST* use {num_ticks} backticks, because some files contain {num_ticks-1} backticks already!"""
|
||||
|
||||
self.fence_ticks = "`" * num_ticks
|
||||
|
||||
number_mapping = {
|
||||
3: "triple",
|
||||
4: "quadruple",
|
||||
5: "quintuple",
|
||||
# 4: "quadruple",
|
||||
# 5: "quintuple",
|
||||
}
|
||||
num_ticks_name = number_mapping.get(num_ticks, str(num_ticks))
|
||||
|
||||
prompt = prompt.format(
|
||||
num_ticks=num_ticks_name,
|
||||
fence=self.fence_ticks,
|
||||
fence=self.get_fence_ticks(),
|
||||
num_ticks_explanation=explain,
|
||||
)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class WholeFileCoder(Coder):
|
||||
fname = None
|
||||
new_lines = []
|
||||
for i, line in enumerate(lines):
|
||||
if line.startswith(self.fence_ticks):
|
||||
if line.startswith(self.get_fence_ticks()):
|
||||
if fname is not None:
|
||||
# ending an existing block
|
||||
saw_fname = None
|
||||
@@ -79,7 +79,7 @@ class WholeFileCoder(Coder):
|
||||
else:
|
||||
# TODO: sense which file it is by diff size
|
||||
raise ValueError(
|
||||
f"No filename provided before {self.fence_ticks} in file listing"
|
||||
f"No filename provided before {self.get_fence_ticks()} in file listing"
|
||||
)
|
||||
|
||||
elif fname is not None:
|
||||
|
||||
Reference in New Issue
Block a user