Buffer::set_rich_text: Only add attrs if they don't match the defaults
This commit is contained in:
parent
6196d72266
commit
241c4ca357
2 changed files with 6 additions and 3 deletions
|
|
@ -704,7 +704,10 @@ impl Buffer {
|
|||
let text_start = line_string.len();
|
||||
line_string.push_str(text);
|
||||
let text_end = line_string.len();
|
||||
attrs_list.add_span(text_start..text_end, *attrs);
|
||||
// Only add attrs if they don't match the defaults
|
||||
if *attrs != attrs_list.defaults() {
|
||||
attrs_list.add_span(text_start..text_end, *attrs);
|
||||
}
|
||||
}
|
||||
|
||||
// we know that at the end of a line,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue