Store ops if buffer handle can't be upgraded and buffer requests are in-flight

This commit is contained in:
Antonio Scandurra 2022-02-24 09:32:31 +01:00
parent a6613d5345
commit 8fa23c702c

View file

@ -2523,6 +2523,8 @@ impl Project {
OpenBuffer::Loaded(buffer) => {
if let Some(buffer) = buffer.upgrade(cx) {
buffer.update(cx, |buffer, cx| buffer.apply_ops(ops, cx))?;
} else if is_remote && buffer_request_count > 0 {
e.insert(OpenBuffer::Loading(ops));
}
}
OpenBuffer::Loading(operations) => operations.extend_from_slice(&ops),