Skip to content

Commit

Permalink
fix: offset number of removed lines in case of multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Nov 15, 2023
1 parent 1ae36ea commit 39092b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discopop_library/LineMapping/diff_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def apply_line_mapping_modifications_from_diff(file_id: int, diff: str):
lhs = diff_entry[: diff_entry.index("d")]
if "," in lhs:
base_line = int(lhs.split(",")[0])
deleted_lines_count = int(lhs.split(",")[1]) - int(lhs.split(",")[0])
deleted_lines_count = int(lhs.split(",")[1]) - int(lhs.split(",")[0]) + 1
else:
base_line = int(lhs)
deleted_lines_count = 1
Expand All @@ -106,7 +106,7 @@ def apply_line_mapping_modifications_from_diff(file_id: int, diff: str):
lhs = diff_entry[: diff_entry.index("c")]
if "," in lhs:
base_line = int(lhs.split(",")[0])
deleted_lines_count = int(lhs.split(",")[1]) - int(lhs.split(",")[0])
deleted_lines_count = int(lhs.split(",")[1]) - int(lhs.split(",")[0]) + 1
else:
base_line = int(lhs)
deleted_lines_count = 1
Expand Down

0 comments on commit 39092b3

Please sign in to comment.