Update cosmic-text to 0.14
This commit is contained in:
parent
c77c4aadd1
commit
6bf6fc60c9
6 changed files with 25 additions and 25 deletions
|
|
@ -47,7 +47,7 @@ impl Text {
|
|||
let mut buffer = cosmic_text::BufferLine::new(
|
||||
&self.content,
|
||||
cosmic_text::LineEnding::default(),
|
||||
cosmic_text::AttrsList::new(text::to_attributes(self.font)),
|
||||
cosmic_text::AttrsList::new(&text::to_attributes(self.font)),
|
||||
text::to_shaping(self.shaping),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ impl Cache {
|
|||
buffer.set_text(
|
||||
font_system,
|
||||
key.content,
|
||||
text::to_attributes(key.font),
|
||||
&text::to_attributes(key.font),
|
||||
text::to_shaping(key.shaping),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ impl editor::Editor for Editor {
|
|||
buffer.set_text(
|
||||
font_system.raw(),
|
||||
text,
|
||||
cosmic_text::Attrs::new(),
|
||||
&cosmic_text::Attrs::new(),
|
||||
cosmic_text::Shaping::Advanced,
|
||||
);
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ impl editor::Editor for Editor {
|
|||
|
||||
for line in buffer.lines.iter_mut() {
|
||||
let _ = line.set_attrs_list(cosmic_text::AttrsList::new(
|
||||
text::to_attributes(new_font),
|
||||
&text::to_attributes(new_font),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -607,7 +607,7 @@ impl editor::Editor for Editor {
|
|||
for line in &mut buffer_mut_from_editor(&mut internal.editor).lines
|
||||
[current_line..=last_visible_line]
|
||||
{
|
||||
let mut list = cosmic_text::AttrsList::new(attributes);
|
||||
let mut list = cosmic_text::AttrsList::new(&attributes);
|
||||
|
||||
for (range, highlight) in highlighter.highlight_line(line.text()) {
|
||||
let format = format_highlight(&highlight);
|
||||
|
|
@ -615,12 +615,12 @@ impl editor::Editor for Editor {
|
|||
if format.color.is_some() || format.font.is_some() {
|
||||
list.add_span(
|
||||
range,
|
||||
cosmic_text::Attrs {
|
||||
&cosmic_text::Attrs {
|
||||
color_opt: format.color.map(text::to_color),
|
||||
..if let Some(font) = format.font {
|
||||
text::to_attributes(font)
|
||||
} else {
|
||||
attributes
|
||||
attributes.clone()
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ impl core::text::Paragraph for Paragraph {
|
|||
buffer.set_text(
|
||||
font_system.raw(),
|
||||
text.content,
|
||||
text::to_attributes(text.font),
|
||||
&text::to_attributes(text.font),
|
||||
text::to_shaping(text.shaping),
|
||||
);
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ impl core::text::Paragraph for Paragraph {
|
|||
|
||||
(span.text.as_ref(), attrs.metadata(i))
|
||||
}),
|
||||
text::to_attributes(text.font),
|
||||
&text::to_attributes(text.font),
|
||||
text::to_shaping(text.shaping),
|
||||
None,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue