pub struct HeaderGroupFoldProvider { /* private fields */ }Expand description
AF.1: one open [lattice_core::Fold] per header run — the rows a user
sees under one header.
The grouping rule handles both header conventions in the tree with one pass, which is what lets this be a shared mechanism rather than an agenda-shaped special case:
- a non-empty title that differs from the current group’s starts a new group (search’s per-excerpt file headers; the agenda’s run labels);
- a non-empty title equal to the current group’s continues it (search’s second and later excerpts from one file);
- an empty title continues the current group (the agenda’s rows after the first of a run — an empty title renders no header row, which is exactly what “I belong to the group above” means).
identity is the group’s TITLE, so the closed/open state survives a gr
refresh — recompute_folds carries state by matching identity, and the
title is what the user was collapsing. That is the same reasoning PD.5a
applied to paths for FileBoundaryFoldProvider, and it holds here for the
same reason: the hit-count badge lives in its own field rather than in
title, so a refresh that changes the count does not change the identity.
Implementations§
Source§impl HeaderGroupFoldProvider
impl HeaderGroupFoldProvider
pub fn new(handle: MultibufferDocumentHandle, buffer_id: BufferId) -> Self
Trait Implementations§
Source§impl FoldSource for HeaderGroupFoldProvider
impl FoldSource for HeaderGroupFoldProvider
Source§fn id(&self) -> ProviderId
fn id(&self) -> ProviderId
This source’s stable id: the same on every call, and distinct from
every other registered source’s (see [
ProviderId]).Source§fn compute_folds(&self) -> Vec<Fold>
fn compute_folds(&self) -> Vec<Fold>
Produce the current fold ranges. Called by the host on recompute, so
it should be cheap (read already-computed state; no I/O).
Auto Trait Implementations§
impl !RefUnwindSafe for HeaderGroupFoldProvider
impl !UnwindSafe for HeaderGroupFoldProvider
impl Freeze for HeaderGroupFoldProvider
impl Send for HeaderGroupFoldProvider
impl Sync for HeaderGroupFoldProvider
impl Unpin for HeaderGroupFoldProvider
impl UnsafeUnpin for HeaderGroupFoldProvider
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
Mutably borrows from an owned value. Read more
§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> ⓘ
Converts
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> ⓘ
Converts
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