📝
This commit is contained in:
parent
f22acb602e
commit
985397b55c
1 changed files with 3 additions and 1 deletions
|
@ -91,6 +91,7 @@ impl RefactoringAssistant {
|
||||||
let mut highlights = Vec::new();
|
let mut highlights = Vec::new();
|
||||||
|
|
||||||
editor.buffer().update(cx, |buffer, cx| {
|
editor.buffer().update(cx, |buffer, cx| {
|
||||||
|
// Avoid grouping assistant edits with user edits.
|
||||||
buffer.finalize_last_transaction(cx);
|
buffer.finalize_last_transaction(cx);
|
||||||
|
|
||||||
buffer.start_transaction(cx);
|
buffer.start_transaction(cx);
|
||||||
|
@ -121,6 +122,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.
|
||||||
buffer.merge_transaction_into(
|
buffer.merge_transaction_into(
|
||||||
transaction,
|
transaction,
|
||||||
first_transaction,
|
first_transaction,
|
||||||
|
@ -128,8 +130,8 @@ impl RefactoringAssistant {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
first_transaction = Some(transaction);
|
first_transaction = Some(transaction);
|
||||||
|
buffer.finalize_last_transaction(cx);
|
||||||
}
|
}
|
||||||
buffer.finalize_last_transaction(cx);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue