From 7e39e1589200d3425a31e7961a407b2c9983d536 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Thu, 8 Jan 2026 01:01:18 -0500 Subject: [PATCH] editor: Don't paint hunk controls when the text area is too narrow to contain them (#46331) Release Notes: - N/A --- crates/editor/src/element.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index fbdbf66f1f5b111dc51196b207f67778f676d436..86dbfe61d7df4a8a1b74ef4cea773e756162c590 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -5791,6 +5791,10 @@ impl EditorElement { let x = text_hitbox.bounds.right() - right_margin - px(10.) - size.width; + if x < text_hitbox.bounds.left() { + continue; + } + let bounds = Bounds::new(gpui::Point::new(x, y), size); control_bounds.push((display_row_range.start, bounds));