#[repr(u8)]pub enum FoldGrouping {
SourceFile = 0,
HeaderRuns = 1,
}Expand description
AF.1: how a multibuffer view’s rows group for folding.
A per-VIEW property because the answer is not a property of multibuffers — it is a property of what a given provider’s rows mean, and the three shipped providers disagree:
- search headers every excerpt with its file path, and its excerpts arrive grouped by file, so a file IS a contiguous run;
- project-diff headers each hunk with its LINE NUMBER, so titles are neither unique nor a grouping key at all — only the source path is;
- the agenda headers the first row of each date/section run and blanks the rest, and its rows deliberately INTERLEAVE across files (OM.A2), so the source path is the one thing that is not a grouping.
Hence a declaration rather than a heuristic. A provider says how its rows
group; the mode registers the matching fold source. Guessing from the
excerpt shape would be right for two of the three and silently wrong for
the third, which is how home.org’s fold came to swallow work.org’s rows.
Variants§
SourceFile = 0
One fold per source file, spanning that file’s first excerpt to its last. The default, and correct wherever excerpts arrive grouped by file.
HeaderRuns = 1
One fold per HEADER RUN — what the user actually sees as a group.
Trait Implementations§
Source§impl Clone for FoldGrouping
impl Clone for FoldGrouping
Source§fn clone(&self) -> FoldGrouping
fn clone(&self) -> FoldGrouping
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FoldGrouping
Source§impl Debug for FoldGrouping
impl Debug for FoldGrouping
impl Eq for FoldGrouping
Source§impl PartialEq for FoldGrouping
impl PartialEq for FoldGrouping
impl StructuralPartialEq for FoldGrouping
Auto Trait Implementations§
impl Freeze for FoldGrouping
impl RefUnwindSafe for FoldGrouping
impl Send for FoldGrouping
impl Sync for FoldGrouping
impl Unpin for FoldGrouping
impl UnsafeUnpin for FoldGrouping
impl UnwindSafe for FoldGrouping
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§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