Skip to content

Commit

Permalink
Fix last != first
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed Jan 24, 2024
1 parent 83cb123 commit 882d4f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cwhy/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ def format_file_locations(filename: str, lines: dict[int, str]) -> str:
last = line_number
else:
result += f"File `{filename}`:\n"
result += llm_utils.number_group_of_lines(group, last)
result += llm_utils.number_group_of_lines(
group, last - len(group) + 1
)
last = None
group = []
if last is not None:
result += f"File `{filename}`:\n"
result += llm_utils.number_group_of_lines(group, last)
result += llm_utils.number_group_of_lines(group, last - len(group) + 1)
return result

formatted_file_locations = [
Expand Down

0 comments on commit 882d4f3

Please sign in to comment.