Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
editor: Fix task indicator layout for wrapped lines
Piotr Osiewicz65f72387771e
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex af64c5f0d24..7e6b2b3573e 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -7738,12 +7738,7 @@ impl Editor {}}).await;- let rows = Self::refresh_runnable_display_rows(- project,- display_snapshot,- new_rows,- cx.clone(),- );+ let rows = Self::runnable_rows(project, display_snapshot, new_rows, cx.clone());this.update(&mut cx, |this, _| {this.clear_tasks();@@ -7760,7 +7755,8 @@ impl Editor {) -> Vec<(Range<usize>, Runnable)> {snapshot.buffer_snapshot.runnable_ranges(range).collect()}- fn refresh_runnable_display_rows(++ fn runnable_rows(project: Model<Project>,snapshot: DisplaySnapshot,runnable_ranges: Vec<(Range<usize>, Runnable)>,@@ -7775,12 +7771,12 @@ impl Editor {if tasks.is_empty() {return None;}- let point = multi_buffer_range.start.to_display_point(&snapshot);+ let point = multi_buffer_range.start.to_point(&snapshot.buffer_snapshot);Some((- point.row(),+ point.row,RunnableTasks {templates: tasks,- column: point.column(),+ column: point.column,},))})diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rsindex 2c54a03ed9a..1872952990c 100644--- a/crates/editor/src/element.rs+++ b/crates/editor/src/element.rs@@ -1381,6 +1381,7 @@ impl EditorElement {scroll_pixel_position: gpui::Point<Pixels>,gutter_dimensions: &GutterDimensions,gutter_hitbox: &Hitbox,+ snapshot: &EditorSnapshot,cx: &mut WindowContext,) -> Vec<AnyElement> {self.editor.update(cx, |editor, cx| {@@ -1409,10 +1410,12 @@ impl EditorElement {*row,cx,);-+ let display_row = Point::new(*row, 0)+ .to_display_point(&snapshot.display_snapshot)+ .row();let button = prepaint_gutter_button(button,- *row,+ display_row,line_height,gutter_dimensions,scroll_pixel_position,@@ -4043,6 +4046,7 @@ impl Element for EditorElement {scroll_pixel_position,&gutter_dimensions,&gutter_hitbox,+ &snapshot,cx,);