pub struct Annotation {
pub text: String,
pub spans: Vec<DisplaySpan>,
}Expand description
HB.5: the row an Entry hangs below itself.
HB.5: one line hung below a row, and how it is coloured.
One line rather than a list: the consistency graph is one row, and
heights and scroll interactions are not worth inventing for a consumer
that does not exist. A list<annotation> is the obvious widening.
Fields§
§text: StringThe line’s text, rendered as-is. Not an excerpt of anything — this is the one place a scan source draws content of its own.
spans: Vec<DisplaySpan>Byte spans into text (NOT into the row’s source line, which this
is not part of), so a guest’s own registered elements
(org.habit.overdue) reach the row with the active colourscheme
applied and no colour crosses the boundary.
A slot here names a THEME ELEMENT, and only that. entry.spans
also accepts tree-sitter capture names (keyword, string),
because those stay a semantic style the cells worker colours at
paint time — but a virtual row’s cells carry a baked colour, so the
annotation resolves its slots when the row is built and a capture
name has nothing to resolve against. An unknown slot renders in the
renderer’s default foreground rather than failing the row.
Validated per span like entry.spans: a bad one costs itself, and
an annotation whose spans are all bad still renders its text. A row
must never lose its annotation because a decoration was malformed.
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl ComponentType for Annotation
Source§impl Debug for Annotation
impl Debug for Annotation
impl Lift for Annotation
impl Lower for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more