优化消息里编辑工具代码行号diff计算

This commit is contained in:
xintaofei
2026-03-28 17:41:19 +08:00
parent 4ea8954535
commit 622d8c90bd

View File

@@ -564,7 +564,7 @@ fn find_hunk_position(
.map(|l| &l[1..]) .map(|l| &l[1..])
.collect(); .collect();
if let Some(pos) = find_contiguous(file_lines, &new_view) { if let Some(pos) = find_contiguous(file_lines, &new_view) {
return Some((pos + 1, new_count, new_count)); return Some((pos + 1, old_count, new_count));
} }
// Strategy 2: contiguous match of context+deleted (pre-patch) // Strategy 2: contiguous match of context+deleted (pre-patch)