Optimize Buffer::set_rich_text for when the buffer is reconstructed
This commit is contained in:
parent
c751217020
commit
b68f4ad5c6
6 changed files with 421 additions and 69 deletions
|
|
@ -373,4 +373,11 @@ impl AttrsList {
|
|||
}
|
||||
new
|
||||
}
|
||||
|
||||
/// Resets the attributes with new defaults.
|
||||
pub(crate) fn reset(mut self, default: Attrs) -> Self {
|
||||
self.defaults = AttrsOwned::new(default);
|
||||
self.spans.clear();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue