pub struct ExcerptFoldProvider { /* private fields */ }Expand description
M.7: computes one open [lattice_core::Fold] per excerpt in the
composed multibuffer. Registered as a
[lattice_core::FoldSource] by MultibufferMode::on_activate
via FoldOverlayService; the FoldSourceAdapter in lattice-host
gates compute_folds to calls where FoldContext::buffer_id
matches this multibuffer’s buffer ID.
Implementations§
Source§impl ExcerptFoldProvider
impl ExcerptFoldProvider
pub fn new(handle: MultibufferDocumentHandle, buffer_id: BufferId) -> Self
Trait Implementations§
Source§impl FoldSource for ExcerptFoldProvider
impl FoldSource for ExcerptFoldProvider
Source§fn compute_folds(&self) -> Vec<Fold>
fn compute_folds(&self) -> Vec<Fold>
One fold per excerpt — except a single-line one, which is not a fold at all (OA.4c).
A fold whose start_line == end_line can never hide anything: closed,
it shows its head, which is the whole of it. Emitting one is not merely
wasteful, it is actively wrong, because innermost_fold_idx picks the
fold with the greatest start_line — so a degenerate per-excerpt fold
SHADOWS the group fold that actually contains the row, and <Tab>
toggles something with no visible effect while the block stays closed.
That is what one-line agenda rows (OA.1) turned this into: before them
an agenda excerpt spanned its planning line, so every fold here was a
real two-line one. The report was “<Tab> doesn’t work cleanly, only
<S-Tab> seems to work” — <S-Tab> sets every fold at once, so it was
unaffected.
Generic, not agenda-shaped: project search with context_lines = 0
produces one-line excerpts too.
Auto Trait Implementations§
impl !RefUnwindSafe for ExcerptFoldProvider
impl !UnwindSafe for ExcerptFoldProvider
impl Freeze for ExcerptFoldProvider
impl Send for ExcerptFoldProvider
impl Sync for ExcerptFoldProvider
impl Unpin for ExcerptFoldProvider
impl UnsafeUnpin for ExcerptFoldProvider
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
§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