diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 3393fbed7633..b8d318bb8690 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -930,6 +930,7 @@ impl Document { let write_result: anyhow::Result<_> = async { let mut dst = tokio::fs::File::create(&write_path).await?; to_writer(&mut dst, encoding_with_bom_info, &text).await?; + dst.sync_all().await?; Ok(()) } .await;