Skip to content

Commit

Permalink
Fix added/removed bytes being visually misaligned in data diff view
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Jan 24, 2025
1 parent e202c3e commit 00abdc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion objdiff-gui/src/views/data_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ fn data_row_ui(
let base_color = get_color_for_diff_kind(diff.kind, appearance);
if diff.data.is_empty() {
let mut str = " ".repeat(diff.len);
str.push_str(" ".repeat(diff.len / 8).as_str());
let n1 = cur_addr / 8;
let n2 = (diff.len + cur_addr) / 8;
str.push_str(" ".repeat(n2 - n1).as_str());
write_text(str.as_str(), base_color, &mut job, appearance.code_font.clone());
cur_addr += diff.len;
} else {
Expand Down

0 comments on commit 00abdc0

Please sign in to comment.