Avoid bright green separators when displaying untitled buffers in multi-buffers (#4024)

Release notes:

- Fixed unstyled excerpt separators when showing untitled buffers in
multi-buffers.
This commit is contained in:
Max Brunsfeld 2024-01-11 12:19:55 -08:00 committed by GitHub
commit cb11fb68cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2269,11 +2269,9 @@ impl EditorElement {
.map_or(range.context.start, |primary| primary.start); .map_or(range.context.start, |primary| primary.start);
let jump_position = language::ToPoint::to_point(&jump_anchor, buffer); let jump_position = language::ToPoint::to_point(&jump_anchor, buffer);
let jump_handler = cx.listener_for(&self.editor, move |editor, _, cx| { cx.listener_for(&self.editor, move |editor, _, cx| {
editor.jump(jump_path.clone(), jump_position, jump_anchor, cx); editor.jump(jump_path.clone(), jump_position, jump_anchor, cx);
}); })
jump_handler
}); });
let element = if *starts_new_buffer { let element = if *starts_new_buffer {
@ -2353,34 +2351,25 @@ impl EditorElement {
.text_color(cx.theme().colors().editor_line_number) .text_color(cx.theme().colors().editor_line_number)
.child("..."), .child("..."),
) )
.map(|this| { .child(
if let Some(jump_handler) = jump_handler { ButtonLike::new("jump to collapsed context")
this.child( .style(ButtonStyle::Transparent)
ButtonLike::new("jump to collapsed context") .full_width()
.style(ButtonStyle::Transparent) .child(
.full_width() div()
.on_click(jump_handler) .h_px()
.tooltip(|cx| { .w_full()
Tooltip::for_action( .bg(cx.theme().colors().border_variant)
"Jump to Buffer", .group_hover("", |style| {
&OpenExcerpts, style.bg(cx.theme().colors().border)
cx, }),
)
})
.child(
div()
.h_px()
.w_full()
.bg(cx.theme().colors().border_variant)
.group_hover("", |style| {
style.bg(cx.theme().colors().border)
}),
),
) )
} else { .when_some(jump_handler, |this, jump_handler| {
this.child(div().size_full().bg(gpui::green())) this.on_click(jump_handler).tooltip(|cx| {
} Tooltip::for_action("Jump to Buffer", &OpenExcerpts, cx)
}) })
}),
)
}; };
element.into_any() element.into_any()
} }