mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Don't panic when ending transaction that wasn't started by the same editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f055053fc9
commit
41ec4645ab
1 changed files with 5 additions and 1 deletions
|
@ -3527,7 +3527,11 @@ impl Editor {
|
|||
.buffer
|
||||
.update(cx, |buffer, cx| buffer.end_transaction_at(now, cx))
|
||||
{
|
||||
self.selection_history.get_mut(&tx_id).unwrap().1 = Some(self.selections.clone());
|
||||
if let Some((_, end_selections)) = self.selection_history.get_mut(&tx_id) {
|
||||
*end_selections = Some(self.selections.clone());
|
||||
} else {
|
||||
log::error!("unexpectedly ended a transaction that wasn't started by this editor");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue