From bc3df45726697eeb16da44054197e0eb462c8b0d Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 31 Jan 2024 23:57:21 +0100 Subject: [PATCH] fix: fetch buffers after creating --- src/workspace.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/workspace.rs b/src/workspace.rs index 4e84326..4fe18b6 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -74,9 +74,12 @@ impl Workspace { tonic::Request::new(BufferPayload { path: path.to_string() }) ).await?; - //add to filetree + // add to filetree self.filetree.insert(path.to_string()); + // fetch buffers + self.fetch_buffers().await?; + Ok(()) } @@ -110,7 +113,7 @@ impl Workspace { } /// get a snapshot of a buffer (meaning its contents as a flat string) - pub async fn snapshot(&mut self, path: &str) -> crate::Result { + pub async fn snapshot(&self, path: &str) -> crate::Result { let mut buffer_client = self.services.buffer.clone(); let contents = buffer_client.snapshot( tonic::Request::new(SnapshotRequest { path: path.to_string() })