Rename SumTree::push_tree to ::append
This commit is contained in:
parent
05d69c804c
commit
8c298a9da5
12 changed files with 60 additions and 60 deletions
|
@ -243,7 +243,7 @@ impl BlockMap {
|
|||
// Preserve any old transforms that precede this edit.
|
||||
let old_start = WrapRow(edit.old.start);
|
||||
let new_start = WrapRow(edit.new.start);
|
||||
new_transforms.push_tree(cursor.slice(&old_start, Bias::Left, &()), &());
|
||||
new_transforms.append(cursor.slice(&old_start, Bias::Left, &()), &());
|
||||
if let Some(transform) = cursor.item() {
|
||||
if transform.is_isomorphic() && old_start == cursor.end(&()) {
|
||||
new_transforms.push(transform.clone(), &());
|
||||
|
@ -425,7 +425,7 @@ impl BlockMap {
|
|||
push_isomorphic(&mut new_transforms, extent_after_edit);
|
||||
}
|
||||
|
||||
new_transforms.push_tree(cursor.suffix(&()), &());
|
||||
new_transforms.append(cursor.suffix(&()), &());
|
||||
debug_assert_eq!(
|
||||
new_transforms.summary().input_rows,
|
||||
wrap_snapshot.max_point().row() + 1
|
||||
|
|
|
@ -115,10 +115,10 @@ impl<'a> FoldMapWriter<'a> {
|
|||
let mut new_tree = SumTree::new();
|
||||
let mut cursor = self.0.folds.cursor::<Fold>();
|
||||
for fold in folds {
|
||||
new_tree.push_tree(cursor.slice(&fold, Bias::Right, &buffer), &buffer);
|
||||
new_tree.append(cursor.slice(&fold, Bias::Right, &buffer), &buffer);
|
||||
new_tree.push(fold, &buffer);
|
||||
}
|
||||
new_tree.push_tree(cursor.suffix(&buffer), &buffer);
|
||||
new_tree.append(cursor.suffix(&buffer), &buffer);
|
||||
new_tree
|
||||
};
|
||||
|
||||
|
@ -165,10 +165,10 @@ impl<'a> FoldMapWriter<'a> {
|
|||
let mut cursor = self.0.folds.cursor::<usize>();
|
||||
let mut folds = SumTree::new();
|
||||
for fold_ix in fold_ixs_to_delete {
|
||||
folds.push_tree(cursor.slice(&fold_ix, Bias::Right, &buffer), &buffer);
|
||||
folds.append(cursor.slice(&fold_ix, Bias::Right, &buffer), &buffer);
|
||||
cursor.next(&buffer);
|
||||
}
|
||||
folds.push_tree(cursor.suffix(&buffer), &buffer);
|
||||
folds.append(cursor.suffix(&buffer), &buffer);
|
||||
folds
|
||||
};
|
||||
|
||||
|
@ -302,7 +302,7 @@ impl FoldMap {
|
|||
cursor.seek(&0, Bias::Right, &());
|
||||
|
||||
while let Some(mut edit) = buffer_edits_iter.next() {
|
||||
new_transforms.push_tree(cursor.slice(&edit.old.start, Bias::Left, &()), &());
|
||||
new_transforms.append(cursor.slice(&edit.old.start, Bias::Left, &()), &());
|
||||
edit.new.start -= edit.old.start - cursor.start();
|
||||
edit.old.start = *cursor.start();
|
||||
|
||||
|
@ -412,7 +412,7 @@ impl FoldMap {
|
|||
}
|
||||
}
|
||||
|
||||
new_transforms.push_tree(cursor.suffix(&()), &());
|
||||
new_transforms.append(cursor.suffix(&()), &());
|
||||
if new_transforms.is_empty() {
|
||||
let text_summary = new_buffer.text_summary();
|
||||
new_transforms.push(
|
||||
|
|
|
@ -353,7 +353,7 @@ impl WrapSnapshot {
|
|||
}
|
||||
|
||||
old_cursor.next(&());
|
||||
new_transforms.push_tree(
|
||||
new_transforms.append(
|
||||
old_cursor.slice(&next_edit.old.start, Bias::Right, &()),
|
||||
&(),
|
||||
);
|
||||
|
@ -366,7 +366,7 @@ impl WrapSnapshot {
|
|||
new_transforms.push_or_extend(Transform::isomorphic(summary));
|
||||
}
|
||||
old_cursor.next(&());
|
||||
new_transforms.push_tree(old_cursor.suffix(&()), &());
|
||||
new_transforms.append(old_cursor.suffix(&()), &());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ impl WrapSnapshot {
|
|||
new_transforms.push_or_extend(Transform::isomorphic(summary));
|
||||
}
|
||||
old_cursor.next(&());
|
||||
new_transforms.push_tree(
|
||||
new_transforms.append(
|
||||
old_cursor.slice(
|
||||
&TabPoint::new(next_edit.old_rows.start, 0),
|
||||
Bias::Right,
|
||||
|
@ -517,7 +517,7 @@ impl WrapSnapshot {
|
|||
new_transforms.push_or_extend(Transform::isomorphic(summary));
|
||||
}
|
||||
old_cursor.next(&());
|
||||
new_transforms.push_tree(old_cursor.suffix(&()), &());
|
||||
new_transforms.append(old_cursor.suffix(&()), &());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1010,7 +1010,7 @@ impl MultiBuffer {
|
|||
|
||||
let suffix = cursor.suffix(&());
|
||||
let changed_trailing_excerpt = suffix.is_empty();
|
||||
new_excerpts.push_tree(suffix, &());
|
||||
new_excerpts.append(suffix, &());
|
||||
drop(cursor);
|
||||
snapshot.excerpts = new_excerpts;
|
||||
snapshot.excerpt_ids = new_excerpt_ids;
|
||||
|
@ -1193,7 +1193,7 @@ impl MultiBuffer {
|
|||
while let Some(excerpt_id) = excerpt_ids.next() {
|
||||
// Seek to the next excerpt to remove, preserving any preceding excerpts.
|
||||
let locator = snapshot.excerpt_locator_for_id(excerpt_id);
|
||||
new_excerpts.push_tree(cursor.slice(&Some(locator), Bias::Left, &()), &());
|
||||
new_excerpts.append(cursor.slice(&Some(locator), Bias::Left, &()), &());
|
||||
|
||||
if let Some(mut excerpt) = cursor.item() {
|
||||
if excerpt.id != excerpt_id {
|
||||
|
@ -1245,7 +1245,7 @@ impl MultiBuffer {
|
|||
}
|
||||
let suffix = cursor.suffix(&());
|
||||
let changed_trailing_excerpt = suffix.is_empty();
|
||||
new_excerpts.push_tree(suffix, &());
|
||||
new_excerpts.append(suffix, &());
|
||||
drop(cursor);
|
||||
snapshot.excerpts = new_excerpts;
|
||||
|
||||
|
@ -1509,7 +1509,7 @@ impl MultiBuffer {
|
|||
let mut cursor = snapshot.excerpts.cursor::<(Option<&Locator>, usize)>();
|
||||
|
||||
for (locator, buffer, buffer_edited) in excerpts_to_edit {
|
||||
new_excerpts.push_tree(cursor.slice(&Some(locator), Bias::Left, &()), &());
|
||||
new_excerpts.append(cursor.slice(&Some(locator), Bias::Left, &()), &());
|
||||
let old_excerpt = cursor.item().unwrap();
|
||||
let buffer = buffer.read(cx);
|
||||
let buffer_id = buffer.remote_id();
|
||||
|
@ -1549,7 +1549,7 @@ impl MultiBuffer {
|
|||
new_excerpts.push(new_excerpt, &());
|
||||
cursor.next(&());
|
||||
}
|
||||
new_excerpts.push_tree(cursor.suffix(&()), &());
|
||||
new_excerpts.append(cursor.suffix(&()), &());
|
||||
|
||||
drop(cursor);
|
||||
snapshot.excerpts = new_excerpts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue