|
|
@ -554,11 +554,9 @@ impl Document {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn set_path(&mut self, path: Option<&Path>) -> Result<(), std::io::Error> {
|
|
|
|
pub fn set_path(&mut self, path: Option<&Path>) -> Result<(), std::io::Error> {
|
|
|
|
let path = if let Some(p) = path {
|
|
|
|
let path = path
|
|
|
|
Some(helix_core::path::get_canonicalized_path(p)?)
|
|
|
|
.map(|path| helix_core::path::get_canonicalized_path(path))
|
|
|
|
} else {
|
|
|
|
.transpose()?;
|
|
|
|
path.map(|p| p.into())
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if parent doesn't exist we still want to open the document
|
|
|
|
// if parent doesn't exist we still want to open the document
|
|
|
|
// and error out when document is saved
|
|
|
|
// and error out when document is saved
|
|
|
|