diff --git a/yazi-fm/src/bg_render.rs b/yazi-fm/src/bg_render.rs index 8e02392d..e130de66 100644 --- a/yazi-fm/src/bg_render.rs +++ b/yazi-fm/src/bg_render.rs @@ -32,12 +32,18 @@ pub fn apply_pane_bg_no_vertical_borders(buf: &mut Buffer, pane: Rect, bg_color: } } -/// Apply background color to entire area +/// Apply background color to entire area, excluding header and status bar #[inline] pub fn apply_overall_bg(buf: &mut Buffer, area: Rect, bg_color: Color) { - for y in area.top()..area.bottom() { - for x in area.left()..area.right() { - buf[(x, y)].set_bg(bg_color); + // Skip the header (top row) and status bar (bottom row) + let start_y = area.top() + 1; + let end_y = if area.bottom() > 0 { area.bottom() - 1 } else { area.bottom() }; + + if start_y < end_y { + for y in start_y..end_y { + for x in area.left()..area.right() { + buf[(x, y)].set_bg(bg_color); + } } } }