This commit is contained in:
Anton-4 2022-02-26 11:05:40 +01:00
parent 26556c631b
commit b46ef4d68d
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD
3 changed files with 19 additions and 26 deletions

View file

@ -47,36 +47,21 @@ 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 },
Underline {
underline_spec: UnderlineSpec,
},
Underline { underline_spec: UnderlineSpec },
}
#[derive(Debug)]
pub enum UnderlineSpec {
Partial{
start: usize,
end: usize,
},
Full
Partial { start: usize, end: usize },
Full,
}
#[derive(Debug, Default)]