Rename merge_transaction_into
to merge_transactions
This commit is contained in:
parent
9674b03855
commit
71a5964c18
4 changed files with 9 additions and 18 deletions
|
@ -193,7 +193,7 @@ impl RefactoringAssistant {
|
||||||
if let Some(transaction) = buffer.end_transaction(cx) {
|
if let Some(transaction) = buffer.end_transaction(cx) {
|
||||||
if let Some(first_transaction) = first_transaction {
|
if let Some(first_transaction) = first_transaction {
|
||||||
// Group all assistant edits into the first transaction.
|
// Group all assistant edits into the first transaction.
|
||||||
buffer.merge_transaction_into(
|
buffer.merge_transactions(
|
||||||
transaction,
|
transaction,
|
||||||
first_transaction,
|
first_transaction,
|
||||||
cx,
|
cx,
|
||||||
|
|
|
@ -615,7 +615,7 @@ impl MultiBuffer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn merge_transaction_into(
|
pub fn merge_transactions(
|
||||||
&mut self,
|
&mut self,
|
||||||
transaction: TransactionId,
|
transaction: TransactionId,
|
||||||
destination: TransactionId,
|
destination: TransactionId,
|
||||||
|
@ -623,7 +623,7 @@ impl MultiBuffer {
|
||||||
) {
|
) {
|
||||||
if let Some(buffer) = self.as_singleton() {
|
if let Some(buffer) = self.as_singleton() {
|
||||||
buffer.update(cx, |buffer, _| {
|
buffer.update(cx, |buffer, _| {
|
||||||
buffer.merge_transaction_into(transaction, destination)
|
buffer.merge_transactions(transaction, destination)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if let Some(transaction) = self.history.remove_transaction(transaction) {
|
if let Some(transaction) = self.history.remove_transaction(transaction) {
|
||||||
|
@ -634,7 +634,7 @@ impl MultiBuffer {
|
||||||
{
|
{
|
||||||
if let Some(state) = self.buffers.borrow().get(&buffer_id) {
|
if let Some(state) = self.buffers.borrow().get(&buffer_id) {
|
||||||
state.buffer.update(cx, |buffer, _| {
|
state.buffer.update(cx, |buffer, _| {
|
||||||
buffer.merge_transaction_into(
|
buffer.merge_transactions(
|
||||||
buffer_transaction_id,
|
buffer_transaction_id,
|
||||||
*destination_buffer_transaction_id,
|
*destination_buffer_transaction_id,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1294,12 +1294,8 @@ impl Buffer {
|
||||||
self.text.forget_transaction(transaction_id);
|
self.text.forget_transaction(transaction_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn merge_transaction_into(
|
pub fn merge_transactions(&mut self, transaction: TransactionId, destination: TransactionId) {
|
||||||
&mut self,
|
self.text.merge_transactions(transaction, destination);
|
||||||
transaction: TransactionId,
|
|
||||||
destination: TransactionId,
|
|
||||||
) {
|
|
||||||
self.text.merge_transaction_into(transaction, destination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn wait_for_edits(
|
pub fn wait_for_edits(
|
||||||
|
|
|
@ -310,7 +310,7 @@ impl History {
|
||||||
Some(&mut entry.transaction)
|
Some(&mut entry.transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn merge_transaction_into(&mut self, transaction: TransactionId, destination: TransactionId) {
|
fn merge_transactions(&mut self, transaction: TransactionId, destination: TransactionId) {
|
||||||
if let Some(transaction) = self.forget(transaction) {
|
if let Some(transaction) = self.forget(transaction) {
|
||||||
if let Some(destination) = self.transaction_mut(destination) {
|
if let Some(destination) = self.transaction_mut(destination) {
|
||||||
destination.edit_ids.extend(transaction.edit_ids);
|
destination.edit_ids.extend(transaction.edit_ids);
|
||||||
|
@ -1225,13 +1225,8 @@ impl Buffer {
|
||||||
self.history.forget(transaction_id);
|
self.history.forget(transaction_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn merge_transaction_into(
|
pub fn merge_transactions(&mut self, transaction: TransactionId, destination: TransactionId) {
|
||||||
&mut self,
|
self.history.merge_transactions(transaction, destination);
|
||||||
transaction: TransactionId,
|
|
||||||
destination: TransactionId,
|
|
||||||
) {
|
|
||||||
self.history
|
|
||||||
.merge_transaction_into(transaction, destination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn redo(&mut self) -> Option<(TransactionId, Operation)> {
|
pub fn redo(&mut self) -> Option<(TransactionId, Operation)> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue