Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

editor: Don't paint hunk controls when the text area is too narrow to contain them (#46331)

Cole Miller7e39e1589200
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index fbdbf66f1f5..86dbfe61d7d 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));