Skip to content

Commit

Permalink
Make :write create nonexistent subdirectories
Browse files Browse the repository at this point in the history
Prompting as to whether this should take place remains a TODO.
  • Loading branch information
Omnikar committed Mar 18, 2022
1 parent 533cca7 commit 5bc2b25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-view/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
}

Expand Down

0 comments on commit 5bc2b25

Please sign in to comment.