Renames: HighlightedText
->HighlightedMatch
+ HighlightedEdits
->HighlightedText
(#24057)
In support of work on https://github.com/zed-industries/zed/tree/new-ui-for-edit-prediction-with-lsp-completions, where we want to be able to extract a range of the buffer as `HighlightedText`. Release Notes: - N/A
This commit is contained in:
parent
4d9659adc4
commit
93c7b54caa
7 changed files with 21 additions and 21 deletions
|
@ -2,19 +2,19 @@ use ui::{prelude::*, HighlightedLabel};
|
|||
|
||||
#[derive(Clone)]
|
||||
pub struct HighlightedMatchWithPaths {
|
||||
pub match_label: HighlightedText,
|
||||
pub paths: Vec<HighlightedText>,
|
||||
pub match_label: HighlightedMatch,
|
||||
pub paths: Vec<HighlightedMatch>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, IntoElement)]
|
||||
pub struct HighlightedText {
|
||||
pub struct HighlightedMatch {
|
||||
pub text: String,
|
||||
pub highlight_positions: Vec<usize>,
|
||||
pub char_count: usize,
|
||||
pub color: Color,
|
||||
}
|
||||
|
||||
impl HighlightedText {
|
||||
impl HighlightedMatch {
|
||||
pub fn join(components: impl Iterator<Item = Self>, separator: &str) -> Self {
|
||||
let mut char_count = 0;
|
||||
let separator_char_count = separator.chars().count();
|
||||
|
@ -48,7 +48,7 @@ impl HighlightedText {
|
|||
Self { color, ..self }
|
||||
}
|
||||
}
|
||||
impl RenderOnce for HighlightedText {
|
||||
impl RenderOnce for HighlightedMatch {
|
||||
fn render(self, _window: &mut Window, _: &mut App) -> impl IntoElement {
|
||||
HighlightedLabel::new(self.text, self.highlight_positions).color(self.color)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue