editor: Remove buffer and display map fields from SelectionsCollection (#42175)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-11-07 11:21:14 +01:00
committed by GitHub
parent c2416d6bab
commit 88a8e53696
18 changed files with 394 additions and 367 deletions
@@ -63,6 +63,14 @@ pub struct BlockSnapshot {
pub(super) excerpt_header_height: u32,
}
impl Deref for BlockSnapshot {
type Target = WrapSnapshot;
fn deref(&self) -> &Self::Target {
&self.wrap_snapshot
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CustomBlockId(pub usize);
@@ -630,6 +630,14 @@ pub struct FoldSnapshot {
pub version: usize,
}
impl Deref for FoldSnapshot {
type Target = InlaySnapshot;
fn deref(&self) -> &Self::Target {
&self.inlay_snapshot
}
}
impl FoldSnapshot {
pub fn buffer(&self) -> &MultiBufferSnapshot {
&self.inlay_snapshot.buffer
@@ -32,6 +32,14 @@ pub struct InlaySnapshot {
pub version: usize,
}
impl std::ops::Deref for InlaySnapshot {
type Target = MultiBufferSnapshot;
fn deref(&self) -> &Self::Target {
&self.buffer
}
}
#[derive(Clone, Debug)]
enum Transform {
Isomorphic(TextSummary),
+8
View File
@@ -167,6 +167,14 @@ pub struct TabSnapshot {
pub version: usize,
}
impl std::ops::Deref for TabSnapshot {
type Target = FoldSnapshot;
fn deref(&self) -> &Self::Target {
&self.fold_snapshot
}
}
impl TabSnapshot {
pub fn buffer_snapshot(&self) -> &MultiBufferSnapshot {
&self.fold_snapshot.inlay_snapshot.buffer
@@ -43,6 +43,14 @@ pub struct WrapSnapshot {
interpolated: bool,
}
impl std::ops::Deref for WrapSnapshot {
type Target = TabSnapshot;
fn deref(&self) -> &Self::Target {
&self.tab_snapshot
}
}
#[derive(Clone, Debug, Default, Eq, PartialEq)]
struct Transform {
summary: TransformSummary,