Fix panic when opening multiple definitions in a multibuffer
The editor is on the stack, so adding an item to the `Pane` containing the editor will cause a double borrow and a consequent panic. This commit fixes the issue by deferring the opening of the definitions.
This commit is contained in:
parent
7e2a461486
commit
121264d35a
1 changed files with 23 additions and 21 deletions
|
@ -5680,6 +5680,7 @@ impl Editor {
|
|||
}
|
||||
} else if !definitions.is_empty() {
|
||||
let replica_id = self.replica_id(cx);
|
||||
cx.window_context().defer(move |cx| {
|
||||
let title = definitions
|
||||
.iter()
|
||||
.find(|definition| definition.origin.is_some())
|
||||
|
@ -5701,7 +5702,8 @@ impl Editor {
|
|||
.collect();
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
Self::open_locations_in_multibuffer(workspace, locations, replica_id, title, cx)
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue