Extract an ExcerptRange containing a context field in multi_buffer

This lays the groundwork for adding an optional `primary` field that can
be supplied to provide the "jump to" feature.
This commit is contained in:
Antonio Scandurra
2022-06-08 12:13:04 +02:00
parent d56cc1a5c1
commit ffb75b0f02
6 changed files with 231 additions and 100 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ use super::{
wrap_map::{self, WrapEdit, WrapPoint, WrapSnapshot},
TextHighlights,
};
use crate::{Anchor, ToPoint as _};
use crate::{Anchor, ExcerptRange, ToPoint as _};
use collections::{Bound, HashMap, HashSet};
use gpui::{ElementBox, RenderContext};
use language::{BufferSnapshot, Chunk, Patch};
@@ -98,7 +98,7 @@ pub enum TransformBlock {
Custom(Arc<Block>),
ExcerptHeader {
buffer: BufferSnapshot,
range: Range<text::Anchor>,
range: ExcerptRange<text::Anchor>,
height: u8,
starts_new_buffer: bool,
},