Fix race condition when opening a buffer and getting a definition to it
This commit is contained in:
parent
93125cbd16
commit
96b66dcce1
7 changed files with 160 additions and 135 deletions
|
@ -305,7 +305,7 @@ impl Buffer {
|
|||
|
||||
pub fn from_proto(
|
||||
replica_id: ReplicaId,
|
||||
message: proto::Buffer,
|
||||
message: proto::BufferState,
|
||||
file: Option<Box<dyn File>>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Result<Self> {
|
||||
|
@ -359,8 +359,8 @@ impl Buffer {
|
|||
Ok(this)
|
||||
}
|
||||
|
||||
pub fn to_proto(&self) -> proto::Buffer {
|
||||
proto::Buffer {
|
||||
pub fn to_proto(&self) -> proto::BufferState {
|
||||
proto::BufferState {
|
||||
id: self.remote_id(),
|
||||
file: self.file.as_ref().map(|f| f.to_proto()),
|
||||
visible_text: self.text.text(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue