pub struct FileBoundaryFoldProvider { /* private fields */ }Expand description
M.8: computes one open [lattice_core::Fold] per distinct source
[BufferId] (file), spanning the composed-row range from the first
to the last excerpt belonging to that file. Registered alongside
ExcerptFoldProvider by MultibufferMode::on_activate. Enables
collapsing all excerpts from a file to its header row with za.
PD.5a: the fold’s identity is derived from the source path,
not its BufferId. recompute_folds carries closed/open state
across a rebuild by matching identity, and a refreshing provider
re-reads its files under fresh BufferId::next() values — so a
BufferId-derived identity changes on every refresh, the match
misses, and every file the user had collapsed springs back open.
The path is what the user was collapsing, so it is what the
identity should track.
Implementations§
Source§impl FileBoundaryFoldProvider
impl FileBoundaryFoldProvider
pub fn new(handle: MultibufferDocumentHandle, buffer_id: BufferId) -> Self
Trait Implementations§
Source§impl FoldSource for FileBoundaryFoldProvider
impl FoldSource for FileBoundaryFoldProvider
Source§fn id(&self) -> ProviderId
fn id(&self) -> ProviderId
ProviderId]).Source§fn compute_folds(&self) -> Vec<Fold>
fn compute_folds(&self) -> Vec<Fold>
Auto Trait Implementations§
impl !RefUnwindSafe for FileBoundaryFoldProvider
impl !UnwindSafe for FileBoundaryFoldProvider
impl Freeze for FileBoundaryFoldProvider
impl Send for FileBoundaryFoldProvider
impl Sync for FileBoundaryFoldProvider
impl Unpin for FileBoundaryFoldProvider
impl UnsafeUnpin for FileBoundaryFoldProvider
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