Updated RangeMap to Add Clear().

This commit is contained in:
Andrew Wheeler 2022-12-29 10:25:01 -05:00 committed by Jeremy Soller
parent b9fef72f76
commit 8614a7a398
3 changed files with 5 additions and 3 deletions

View file

@ -20,7 +20,7 @@ sys-locale = { version = "0.2.3", optional = true }
unicode-linebreak = "0.1.4"
unicode-script = "0.5.5"
unicode-segmentation = "1.10.0"
rangemap = "1.1.0"
rangemap = "1.2.0"
[dependencies.unicode-bidi]
version = "0.3.8"

View file

@ -121,6 +121,9 @@ fn main() {
("O", attrs.color(Color::rgb(0xFF, 0xFF, 0x00))),
("R", attrs.color(Color::rgb(0xFF, 0x7F, 0x00))),
("N", attrs.color(Color::rgb(0xFF, 0x00, 0x00))),
],
&[
("生活,삶,जिंदगी 😀 FPS", attrs.color(Color::rgb(0xFF, 0x00, 0x00)))
]
];
for &line in lines {

View file

@ -251,8 +251,7 @@ impl AttrsList {
/// Clear the current attribute spans
pub fn clear_spans(&mut self) {
//Todo: Once clear is added Change this back to clear.
self.spans = RangeMap::new();
self.spans.clear();
}
/// Add an attribute span, removes any previous matching parts of spans