fix: align diff picker review checkmarks
This commit is contained in:
+13
-10
@@ -4694,13 +4694,8 @@ fn draw_file_list(
|
||||
&& entry.catalog_index.is_some_and(|index| {
|
||||
changed_files.is_some_and(|(_, reviewed)| reviewed.contains(&index))
|
||||
});
|
||||
spans.push(Span::raw(if selected { ">" } else { " " }));
|
||||
if changed_files.is_some() {
|
||||
spans.push(Span::styled(
|
||||
if reviewed { "✓" } else { " " },
|
||||
Style::default().fg(Color::Green),
|
||||
));
|
||||
} else {
|
||||
if changed_files.is_none() {
|
||||
spans.push(Span::raw(if selected { ">" } else { " " }));
|
||||
spans.push(Span::raw(" "));
|
||||
}
|
||||
spans.push(Span::raw(if picker.view == FileView::Tree {
|
||||
@@ -4708,6 +4703,13 @@ fn draw_file_list(
|
||||
} else {
|
||||
String::new()
|
||||
}));
|
||||
if changed_files.is_some() {
|
||||
spans.push(Span::styled(
|
||||
if reviewed { "✓" } else { " " },
|
||||
Style::default().fg(Color::Green),
|
||||
));
|
||||
spans.push(Span::raw(" "));
|
||||
}
|
||||
if let Some(status) = status {
|
||||
let color = match status {
|
||||
FileStatus::Added => Color::Green,
|
||||
@@ -7320,9 +7322,10 @@ mod tests {
|
||||
.unwrap_or_else(|| panic!("missing {expected}"));
|
||||
assert_eq!(buffer[(x, y)].fg, color);
|
||||
assert_eq!(
|
||||
buffer[(2, y)].symbol(),
|
||||
buffer[(x - 2, y)].symbol(),
|
||||
if catalog_index == index { "✓" } else { " " }
|
||||
);
|
||||
assert_eq!(buffer[(x - 1, y)].symbol(), " ");
|
||||
let depth = picker
|
||||
.entries()
|
||||
.find(|entry| entry.catalog_index == Some(catalog_index))
|
||||
@@ -7337,9 +7340,9 @@ mod tests {
|
||||
}
|
||||
);
|
||||
if catalog_index == index {
|
||||
assert_eq!(buffer[(2, y)].fg, Color::Green);
|
||||
assert_eq!(buffer[(x - 2, y)].fg, Color::Green);
|
||||
assert_eq!(
|
||||
buffer[(2, y)].bg,
|
||||
buffer[(x - 2, y)].bg,
|
||||
if focused {
|
||||
Color::Blue
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user