Only reset lines where highlight changes
This commit is contained in:
parent
6f7e59e092
commit
f85223b376
2 changed files with 8 additions and 3 deletions
|
|
@ -61,6 +61,9 @@ fn main() {
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer.set_text(&text);
|
buffer.set_text(&text);
|
||||||
|
for line in buffer.lines.iter_mut() {
|
||||||
|
line.wrap_simple = true;
|
||||||
|
}
|
||||||
|
|
||||||
let mut bg_color = orbclient::Color::rgb(0x00, 0x00, 0x00);
|
let mut bg_color = orbclient::Color::rgb(0x00, 0x00, 0x00);
|
||||||
let mut font_color = orbclient::Color::rgb(0xFF, 0xFF, 0xFF);
|
let mut font_color = orbclient::Color::rgb(0xFF, 0xFF, 0xFF);
|
||||||
|
|
@ -152,9 +155,10 @@ fn main() {
|
||||||
start = end;
|
start = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
line.attrs_list = attrs_list;
|
if attrs_list != line.attrs_list {
|
||||||
line.wrap_simple = true;
|
line.attrs_list = attrs_list;
|
||||||
line.reset();
|
line.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rehighlight = false;
|
rehighlight = false;
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ impl<'a> Attrs<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Eq, PartialEq)]
|
||||||
pub struct AttrsList<'a> {
|
pub struct AttrsList<'a> {
|
||||||
defaults: Attrs<'a>,
|
defaults: Attrs<'a>,
|
||||||
spans: Vec<(usize, usize, Attrs<'a>)>,
|
spans: Vec<(usize, usize, Attrs<'a>)>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue