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.

Fix inline assist deletion blocks (#15651)

Nathan Sobo1b85793ebc35
diff --git a/crates/assistant/src/inline_assistant.rs b/crates/assistant/src/inline_assistant.rs
index 4d2a1225c21..caf7a12ef0a 100644
--- a/crates/assistant/src/inline_assistant.rs
+++ b/crates/assistant/src/inline_assistant.rs
@@ -1015,6 +1015,7 @@ impl InlineAssistant {
div()
.bg(cx.theme().status().deleted_background)
.size_full()
+ .h(height as f32 * cx.line_height())
.pl(cx.gutter_dimensions.full_width())
.child(deleted_lines_editor.clone())
.into_any_element()
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index 3c11010ace9..05db51883f1 100644
--- a/crates/editor/src/element.rs
+++ b/crates/editor/src/element.rs
@@ -2373,7 +2373,7 @@ impl EditorElement {
};
if let BlockId::Custom(custom_block_id) = block_id {
- let element_height_in_lines = (final_size.height / line_height).ceil() as u32;
+ let element_height_in_lines = ((final_size.height / line_height).ceil() as u32).max(1);
if element_height_in_lines != block.height() {
resized_blocks.insert(custom_block_id, element_height_in_lines);
}