pub struct UnchangedFoldSource { /* private fields */ }Expand description
D-fix.5 (2026-06-26): per-buffer, per-side unchanged-fold source
— vimdiff foldmethod=diff / VS Code “Collapse Unchanged Regions”.
Where HunkFoldSource folds the hunks (open by default — za
collapses a change), this folds their complement: the unchanged
gaps between hunks, minus a context-line window around each change,
closed by default so a diff opens showing only the changes. The
two coexist on the same buffer over disjoint line regions.
Both sides, in lockstep. diff-mode::on_activate registers one
per participant buffer (resolving each side’s slot via
DiffSubsystem::participant_slot), so a side-by-side :diffsplit /
openDiff folds the baseline and current panes symmetrically — the
scroll-bound panes stay vertically aligned (folding only one side
would desync them).
Option-gated, read live at compute_folds time from the
ConfigRegistry service: ui.diff.fold-unchanged (default on) +
ui.diff.context (default 6). No config service / option absent ⇒
the safe defaults (fold on, context 6) — never a panic.
Implementations§
Source§impl UnchangedFoldSource
impl UnchangedFoldSource
Sourcepub fn new(
session: Arc<DiffSession>,
buffer_id: BufferId,
slot: usize,
config: Option<Arc<ConfigRegistry>>,
) -> UnchangedFoldSource
pub fn new( session: Arc<DiffSession>, buffer_id: BufferId, slot: usize, config: Option<Arc<ConfigRegistry>>, ) -> UnchangedFoldSource
Build a source for session at slot, namespaced by buffer_id
(distinct from the buffer’s hunk-fold source via
UNCHANGED_FOLD_NAMESPACE). config is the ConfigRegistry
service handle the mode pulls in on_activate (or None ⇒
defaults).
Trait Implementations§
Source§impl FoldSource for UnchangedFoldSource
impl FoldSource for UnchangedFoldSource
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 Freeze for UnchangedFoldSource
impl RefUnwindSafe for UnchangedFoldSource
impl Send for UnchangedFoldSource
impl Sync for UnchangedFoldSource
impl Unpin for UnchangedFoldSource
impl UnsafeUnpin for UnchangedFoldSource
impl UnwindSafe for UnchangedFoldSource
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for 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