fix: use cell-edge diagonals for diff gap hatching
This commit is contained in:
+4
-4
@@ -1297,7 +1297,7 @@ fn draw_diff_pane(
|
||||
let buffer = frame.buffer_mut();
|
||||
for x in 0..content.width {
|
||||
buffer[(content.x + x, row_area.y)]
|
||||
.set_symbol("/")
|
||||
.set_symbol("╱")
|
||||
.set_style(style);
|
||||
}
|
||||
continue;
|
||||
@@ -2567,7 +2567,7 @@ mod tests {
|
||||
let gap_symbols: Vec<_> = (after.x + 1..after.right() - 1)
|
||||
.map(|x| {
|
||||
let cell = &buffer[(x, y)];
|
||||
assert_eq!(cell.symbol(), "/");
|
||||
assert_eq!(cell.symbol(), "╱");
|
||||
assert_eq!(cell.bg, Color::Reset);
|
||||
assert_eq!(cell.fg, Color::Rgb(72, 72, 72));
|
||||
cell.symbol().to_owned()
|
||||
@@ -2617,7 +2617,7 @@ mod tests {
|
||||
let y = before.y + 1 + offset;
|
||||
for x in before.x + 1..before.right() - 1 {
|
||||
let cell = &buffer[(x, y)];
|
||||
assert_eq!(cell.symbol(), "/");
|
||||
assert_eq!(cell.symbol(), "╱");
|
||||
assert_eq!(cell.bg, Color::Reset);
|
||||
assert_eq!(cell.fg, Color::Rgb(72, 72, 72));
|
||||
}
|
||||
@@ -2637,7 +2637,7 @@ mod tests {
|
||||
render_diff(&mut terminal, &diff, &mut panels);
|
||||
let buffer = terminal.backend().buffer();
|
||||
for x in before.x + 1..before.right() - 1 {
|
||||
assert_eq!(buffer[(x, before.y + 1)].symbol(), "/");
|
||||
assert_eq!(buffer[(x, before.y + 1)].symbol(), "╱");
|
||||
}
|
||||
assert_eq!(buffer[(before.x, before.y + 1)].symbol(), "│");
|
||||
assert_eq!(buffer[(before.right() - 1, before.y + 1)].symbol(), "│");
|
||||
|
||||
Reference in New Issue
Block a user