From 10a3d26ef60ff887e6436e542ae576f303d1feec Mon Sep 17 00:00:00 2001 From: Lukas Rothenberger Date: Tue, 14 Nov 2023 02:12:23 +0100 Subject: [PATCH] fix: offset number of removed lines in case of multiple lines --- discopop_library/LineMapping/diff_modifications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discopop_library/LineMapping/diff_modifications.py b/discopop_library/LineMapping/diff_modifications.py index e9a02986c..f12cd51c2 100644 --- a/discopop_library/LineMapping/diff_modifications.py +++ b/discopop_library/LineMapping/diff_modifications.py @@ -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 @@ -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