pub struct ProjectDiffDeletionRows { /* private fields */ }Expand description
The view-touching half. Spawn a source document per file, add it
to view’s source map, and append one excerpt per hunk.
Returns the number of excerpts appended, so the caller can keep a running hunk count for the headerline without re-reading the view.
Appending (rather than replacing) is what makes the view fill progressively: the user sees the first files while the rest are still being read. PD.7b: the removed lines, as virtual rows.
A removed line has no row in the working-tree file — that is what
removed means — so it cannot be painted like a changed one. It renders
as a DeletionBlock virtual row anchored above the post-image line the
deletion sat at.
Composed anchors are computed here, per collect(), from the view’s
current excerpt list — never cached. That is what makes the rows
slide when the user types: an edit shifts the excerpts, the next
collect reads the shifted excerpts, and the ghosts move with them. A
stored composed anchor would detach on the first keystroke, which is
the drift PD.7 flagged.
Known ceiling, chosen deliberately: these rows are display-only, so removed text cannot be searched, selected or copied. Zed shipped this same shape first and later spent a large refactor making deleted hunks ordinary text in the editor’s coordinate space precisely to get those three back. We take the simpler form because it preserves the one-composed-row-one-source-line invariant the whole edit-propagation path rests on — the invariant whose violation caused the line-number off-by-one. If searchable deletions are wanted later, that is the change, and it is a substrate change rather than a provider one.
Implementations§
Trait Implementations§
Source§impl Debug for ProjectDiffDeletionRows
impl Debug for ProjectDiffDeletionRows
Source§impl VirtualRowProvider for ProjectDiffDeletionRows
impl VirtualRowProvider for ProjectDiffDeletionRows
Source§fn id(&self) -> ProviderId
fn id(&self) -> ProviderId
Source§fn version(&self) -> u64
fn version(&self) -> u64
Self::collect] would emit have
changed. The worker uses the combined fingerprint of all
providers’ versions to short-circuit on the cache-hit
path without paying for the (potentially expensive)
collect calls. Read moreAuto Trait Implementations§
impl !Freeze for ProjectDiffDeletionRows
impl !RefUnwindSafe for ProjectDiffDeletionRows
impl !UnwindSafe for ProjectDiffDeletionRows
impl Send for ProjectDiffDeletionRows
impl Sync for ProjectDiffDeletionRows
impl Unpin for ProjectDiffDeletionRows
impl UnsafeUnpin for ProjectDiffDeletionRows
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