Use replace blocks for patches (#20605)

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
Antonio Scandurra
2024-11-13 18:55:23 +01:00
committed by GitHub
co-authored by Max Richard
parent 96deabfb78
commit 92613a8904
13 changed files with 925 additions and 918 deletions
+4 -2
View File
@@ -425,7 +425,7 @@ impl Editor {
height: 1,
style: BlockStyle::Sticky,
priority: 0,
render: Box::new({
render: Arc::new({
let editor = cx.view().clone();
let hunk = hunk.clone();
@@ -435,6 +435,7 @@ impl Editor {
h_flex()
.id(cx.block_id)
.occlude()
.h(cx.line_height())
.w_full()
.border_t_1()
@@ -707,12 +708,13 @@ impl Editor {
height,
style: BlockStyle::Flex,
priority: 0,
render: Box::new(move |cx| {
render: Arc::new(move |cx| {
let width = EditorElement::diff_hunk_strip_width(cx.line_height());
let gutter_dimensions = editor.read(cx.context).gutter_dimensions;
h_flex()
.id(cx.block_id)
.occlude()
.bg(deleted_hunk_color)
.h(height as f32 * cx.line_height())
.w_full()