feat: apply declarative render rule across components
This commit is contained in:
@@ -546,24 +546,25 @@ fn render_row(
|
||||
},
|
||||
)
|
||||
.when(options.line_numbers, |row_element| {
|
||||
let mut number = gutter_cell(
|
||||
cx,
|
||||
colors.muted_foreground,
|
||||
row.new_number
|
||||
.or(row.old_number)
|
||||
.map(|number| number.to_string())
|
||||
.unwrap_or_default(),
|
||||
row_element.child(
|
||||
gutter_cell(
|
||||
cx,
|
||||
colors.muted_foreground,
|
||||
row.new_number
|
||||
.or(row.old_number)
|
||||
.map(|number| number.to_string())
|
||||
.unwrap_or_default(),
|
||||
)
|
||||
.w_10()
|
||||
.whitespace_nowrap()
|
||||
.bg(match row.kind {
|
||||
DiffRowKind::Context => wash_gutter(&colors),
|
||||
_ => wash_strong(change_color),
|
||||
})
|
||||
.when(options.indicators == DiffIndicators::Bars, |number| {
|
||||
number.border_l_4().border_color(change_color)
|
||||
}),
|
||||
)
|
||||
.w_10()
|
||||
.whitespace_nowrap()
|
||||
.bg(match row.kind {
|
||||
DiffRowKind::Context => wash_gutter(&colors),
|
||||
_ => wash_strong(change_color),
|
||||
});
|
||||
if options.indicators == DiffIndicators::Bars {
|
||||
number = number.border_l_4().border_color(change_color);
|
||||
}
|
||||
row_element.child(number)
|
||||
})
|
||||
.when(
|
||||
options.indicators == DiffIndicators::Bars && !options.line_numbers,
|
||||
|
||||
Reference in New Issue
Block a user