Return TextRun
s in combine_syntax_and_fuzzy_match_highlights
This commit is contained in:
parent
22e6803fc6
commit
bf39968105
3 changed files with 62 additions and 45 deletions
|
@ -168,7 +168,8 @@ impl Default for TextStyle {
|
|||
}
|
||||
|
||||
impl TextStyle {
|
||||
pub fn highlight(mut self, style: HighlightStyle) -> Self {
|
||||
pub fn highlight(mut self, style: impl Into<HighlightStyle>) -> Self {
|
||||
let style = style.into();
|
||||
if let Some(weight) = style.font_weight {
|
||||
self.font_weight = weight;
|
||||
}
|
||||
|
@ -502,6 +503,15 @@ impl From<Hsla> for HighlightStyle {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<FontWeight> for HighlightStyle {
|
||||
fn from(font_weight: FontWeight) -> Self {
|
||||
Self {
|
||||
font_weight: Some(font_weight),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Rgba> for HighlightStyle {
|
||||
fn from(color: Rgba) -> Self {
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue