feat: only render unline if attribute is there

This commit is contained in:
rvcas 2022-02-25 13:02:35 -05:00
parent 0853c0bdb7
commit 6e752645a6
No known key found for this signature in database
GPG key ID: C09B64E263F7D68C
2 changed files with 58 additions and 28 deletions

View file

@ -47,16 +47,28 @@ pub struct UnderlineEnd {
#[derive(Debug)]
pub enum Attribute {
// Rust does not yet support types for enum variants so we have to do it like this
Caret { caret: Caret },
Caret {
caret: Caret,
},
SelectionStart { selection_start: SelectionStart },
SelectionEnd { selection_end: SelectionEnd },
SelectionStart {
selection_start: SelectionStart,
},
SelectionEnd {
selection_end: SelectionEnd,
},
HighlightStart { highlight_start: HighlightStart },
HighlightEnd { highlight_end: HighlightEnd },
HighlightStart {
highlight_start: HighlightStart,
},
HighlightEnd {
highlight_end: HighlightEnd,
},
UnderlineStart { underline_start: UnderlineStart },
UnderlineEnd { underline_end: UnderlineEnd },
Underline {
underline_start: UnderlineStart,
underline_end: UnderlineEnd,
},
}
#[derive(Debug, Default)]