-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add :write!
to create nonexistent subdirectories
#1839
Conversation
:write
create nonexistant subdirectories:write
create nonexistent subdirectories
Prompting as to whether this should take place remains a TODO.
66c2870
to
5bc2b25
Compare
helix-view/src/document.rs
Outdated
// 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)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should at least show a status message that new directories were created (or even better a prompt like the TODO says).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would we display a status message or a prompt from this function?
Should this be a part of |
Oh, that seems like a good idea. |
That seems better, we could also show a message on a failing |
That's a great idea. Best of both worlds. |
What do we want to do about the functionality of |
I think this ^
|
:write
create nonexistent subdirectories:write!
to create nonexistent subdirectories
Closes #1834.