Fix 'invalid insertion' panic when following

Wait for the necessary buffer operations to arrive before attempting to
set selections and scroll top.
This commit is contained in:
Max Brunsfeld 2023-04-18 16:13:18 -07:00
parent a8b3826955
commit bd7d50f339
6 changed files with 229 additions and 167 deletions

View file

@ -1313,10 +1313,10 @@ impl Buffer {
self.text.wait_for_edits(edit_ids)
}
pub fn wait_for_anchors<'a>(
pub fn wait_for_anchors(
&mut self,
anchors: impl IntoIterator<Item = &'a Anchor>,
) -> impl Future<Output = Result<()>> {
anchors: impl IntoIterator<Item = Anchor>,
) -> impl 'static + Future<Output = Result<()>> {
self.text.wait_for_anchors(anchors)
}