style: remove whole-file addition and deletion backgrounds
This commit is contained in:
+9
-8
@@ -1505,15 +1505,16 @@ fn draw_diff_pane(
|
||||
let changed = matches!(row.kind, RowKind::Changed)
|
||||
|| (before && row.kind == RowKind::Removed)
|
||||
|| (!before && row.kind == RowKind::Added);
|
||||
let background = if changed {
|
||||
if before {
|
||||
Color::Rgb(64, 24, 24)
|
||||
let background =
|
||||
if changed && !matches!(file.status, FileStatus::Added | FileStatus::Removed) {
|
||||
if before {
|
||||
Color::Rgb(64, 24, 24)
|
||||
} else {
|
||||
Color::Rgb(24, 48, 32)
|
||||
}
|
||||
} else {
|
||||
Color::Rgb(24, 48, 32)
|
||||
}
|
||||
} else {
|
||||
Color::Reset
|
||||
};
|
||||
Color::Reset
|
||||
};
|
||||
let text = if source_text.chars().any(|ch| ch.is_control() && ch != '\t') {
|
||||
Cow::Owned(
|
||||
source_text
|
||||
|
||||
Reference in New Issue
Block a user