diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 671ceb75f84ff..dab2f1ff8ac72 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -471,7 +471,7 @@ impl Document { if let Some(parent) = path.parent() { // TODO: display a prompt asking the user if the directories should be created if !parent.exists() { - bail!("can't save file, parent directory does not exist"); + std::fs::DirBuilder::new().recursive(true).create(parent)?; } }