Create blocks with anchors to allow a bias to be specified
This allows us to respect the bias on anchors we use to create excerpt headers so that they always remain above any content inserted at the start of an excerpt.
This commit is contained in:
parent
984378e12c
commit
6d6a82655a
3 changed files with 23 additions and 29 deletions
|
@ -123,14 +123,11 @@ impl DisplayMap {
|
|||
self.block_map.read(snapshot, edits);
|
||||
}
|
||||
|
||||
pub fn insert_blocks<P>(
|
||||
pub fn insert_blocks(
|
||||
&mut self,
|
||||
blocks: impl IntoIterator<Item = BlockProperties<P>>,
|
||||
blocks: impl IntoIterator<Item = BlockProperties<Anchor>>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Vec<BlockId>
|
||||
where
|
||||
P: ToOffset + Clone,
|
||||
{
|
||||
) -> Vec<BlockId> {
|
||||
let snapshot = self.buffer.read(cx).snapshot(cx);
|
||||
let edits = self.buffer_subscription.consume().into_inner();
|
||||
let (snapshot, edits) = self.fold_map.read(snapshot, edits);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue