diff --git a/crates/ui/src/input/element.rs b/crates/ui/src/input/element.rs index 7f9ff6d22..52db7ce23 100644 --- a/crates/ui/src/input/element.rs +++ b/crates/ui/src/input/element.rs @@ -2122,25 +2122,18 @@ impl Element for TextElement { if let Some(line_numbers) = prepaint.line_numbers.as_ref() { offset_y += invisible_top_padding; - // Gutter background: prefer the dedicated `editor.gutter.background` - // theme key, falling back to the editor background so existing - // themes render unchanged. - let gutter_bg = cx - .theme() - .highlight_theme - .style - .editor_gutter_background - .unwrap_or_else(|| cx.theme().editor_background()); - window.paint_quad(fill( - Bounds { - origin: input_bounds.origin, - size: size( - prepaint.last_layout.line_number_width - LINE_NUMBER_RIGHT_MARGIN, - input_bounds.size.height + prepaint.ghost_lines_height, - ), - }, - gutter_bg, - )); + if let Some(gutter_bg) = cx.theme().highlight_theme.style.editor_gutter_background { + window.paint_quad(fill( + Bounds { + origin: input_bounds.origin, + size: size( + prepaint.last_layout.line_number_width - LINE_NUMBER_RIGHT_MARGIN, + input_bounds.size.height + prepaint.ghost_lines_height, + ), + }, + gutter_bg, + )); + } // Each item is the normal lines. for (lines, &buffer_line) in line_numbers