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 blank line cursor width (#22275)

Aaron Feickert7c03e11cfc81
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index 69ee6a74eaa..537ab003531 100644
--- a/crates/editor/src/element.rs
+++ b/crates/editor/src/element.rs
@@ -1032,6 +1032,7 @@ impl EditorElement {
scroll_pixel_position: gpui::Point<Pixels>,
line_height: Pixels,
em_width: Pixels,
+ em_advance: Pixels,
autoscroll_containing_element: bool,
cx: &mut WindowContext,
) -> Vec<CursorLayout> {
@@ -1058,7 +1059,7 @@ impl EditorElement {
let mut block_width =
cursor_row_layout.x_for_index(cursor_column + 1) - cursor_character_x;
if block_width == Pixels::ZERO {
- block_width = em_width;
+ block_width = em_advance;
}
let block_text = if let CursorShape::Block = selection.cursor_shape {
snapshot
@@ -6246,6 +6247,7 @@ impl Element for EditorElement {
scroll_pixel_position,
line_height,
em_width,
+ em_advance,
autoscroll_containing_element,
cx,
);