Fix issues with Claude in Assistant2 (#12619)
Release Notes: - N/A --------- Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
@@ -554,6 +554,20 @@ pub struct GutterDimensions {
|
||||
pub git_blame_entries_width: Option<Pixels>,
|
||||
}
|
||||
|
||||
impl GutterDimensions {
|
||||
/// The full width of the space taken up by the gutter.
|
||||
pub fn full_width(&self) -> Pixels {
|
||||
self.margin + self.width
|
||||
}
|
||||
|
||||
/// The width of the space reserved for the fold indicators,
|
||||
/// use alongside 'justify_end' and `gutter_width` to
|
||||
/// right align content with the line numbers
|
||||
pub fn fold_area_width(&self) -> Pixels {
|
||||
self.margin + self.right_padding
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for GutterDimensions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
||||
@@ -1125,9 +1125,7 @@ impl EditorElement {
|
||||
ix as f32 * line_height - (scroll_pixel_position.y % line_height),
|
||||
);
|
||||
let centering_offset = point(
|
||||
(gutter_dimensions.right_padding + gutter_dimensions.margin
|
||||
- fold_indicator_size.width)
|
||||
/ 2.,
|
||||
(gutter_dimensions.fold_area_width() - fold_indicator_size.width) / 2.,
|
||||
(line_height - fold_indicator_size.height) / 2.,
|
||||
);
|
||||
let origin = gutter_hitbox.origin + position + centering_offset;
|
||||
@@ -4629,7 +4627,7 @@ impl Element for EditorElement {
|
||||
&mut scroll_width,
|
||||
&gutter_dimensions,
|
||||
em_width,
|
||||
gutter_dimensions.width + gutter_dimensions.margin,
|
||||
gutter_dimensions.full_width(),
|
||||
line_height,
|
||||
&line_layouts,
|
||||
cx,
|
||||
|
||||
@@ -320,7 +320,7 @@ impl Editor {
|
||||
div()
|
||||
.bg(deleted_hunk_color)
|
||||
.size_full()
|
||||
.pl(gutter_dimensions.width + gutter_dimensions.margin)
|
||||
.pl(gutter_dimensions.full_width())
|
||||
.child(editor_with_deleted_text.clone())
|
||||
.into_any_element()
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user