fix: fetch buffers after creating

This commit is contained in:
zaaarf 2024-01-31 23:57:21 +01:00
parent f7fcf8bd22
commit bc3df45726

View file

@ -74,9 +74,12 @@ impl Workspace {
tonic::Request::new(BufferPayload { path: path.to_string() }) tonic::Request::new(BufferPayload { path: path.to_string() })
).await?; ).await?;
//add to filetree // add to filetree
self.filetree.insert(path.to_string()); self.filetree.insert(path.to_string());
// fetch buffers
self.fetch_buffers().await?;
Ok(()) Ok(())
} }
@ -110,7 +113,7 @@ impl Workspace {
} }
/// get a snapshot of a buffer (meaning its contents as a flat string) /// get a snapshot of a buffer (meaning its contents as a flat string)
pub async fn snapshot(&mut self, path: &str) -> crate::Result<String> { pub async fn snapshot(&self, path: &str) -> crate::Result<String> {
let mut buffer_client = self.services.buffer.clone(); let mut buffer_client = self.services.buffer.clone();
let contents = buffer_client.snapshot( let contents = buffer_client.snapshot(
tonic::Request::new(SnapshotRequest { path: path.to_string() }) tonic::Request::new(SnapshotRequest { path: path.to_string() })