From d959719f3e18a06cfcd962f4c9c435316a42ce88 Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 12 Feb 2024 10:40:26 -0500 Subject: [PATCH] Use local player selection color, not cursor, for terminal selection --- crates/editor/src/element.rs | 6 +++--- crates/terminal_view/src/terminal_element.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index e504c0f68018aa15f4c8f4183f9feeebd8b9678e..db9441a57799d1bcf1c7fcd595fcdde44a64b633 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1015,13 +1015,13 @@ impl EditorElement { let corner_radius = 0.15 * layout.position_map.line_height; let mut invisible_display_ranges = SmallVec::<[Range; 32]>::new(); - for (participant_ix, (selection_style, selections)) in + for (participant_ix, (player_color, selections)) in layout.selections.iter().enumerate() { for selection in selections.into_iter() { self.paint_highlighted_range( selection.range.clone(), - selection_style.selection, + player_color.selection, corner_radius, corner_radius * 2., layout, @@ -1102,7 +1102,7 @@ impl EditorElement { } cursors.push(Cursor { - color: selection_style.cursor, + color: player_color.cursor, block_width, origin: point(x, y), line_height: layout.position_map.line_height, diff --git a/crates/terminal_view/src/terminal_element.rs b/crates/terminal_view/src/terminal_element.rs index 4b80e3001a62d7bd77f422a1473e1d7dff25180e..b4ee25335539285db772fba3928b1fed2b4fd236 100644 --- a/crates/terminal_view/src/terminal_element.rs +++ b/crates/terminal_view/src/terminal_element.rs @@ -447,7 +447,7 @@ impl TerminalElement { }; let text_system = cx.text_system(); - let selection_color = theme.players().local(); + let player_color = theme.players().local(); let match_color = theme.colors().search_match_background; let gutter; let dimensions = { @@ -526,7 +526,7 @@ impl TerminalElement { } if let Some(selection) = selection { relative_highlighted_ranges - .push((selection.start..=selection.end, selection_color.cursor)); + .push((selection.start..=selection.end, player_color.selection)); } // then have that representation be converted to the appropriate highlight data structure