@@ -708,7 +708,7 @@ impl Document {
708 let mut doc = Self::from(rope, Some((encoding, has_bom)), config);
708 let mut doc = Self::from(rope, Some((encoding, has_bom)), config);
710 // set the path and try detecting the language
710 // set the path and try detecting the language
711− doc.set_path(Some(path))?;
711+ doc.set_path(Some(path));
712 if let Some(loader) = config_loader {
712 if let Some(loader) = config_loader {
713 doc.detect_language(loader);
713 doc.detect_language(loader);
@@ -853,7 +853,7 @@ impl Document {
853 let text = self.text().clone();
853 let text = self.text().clone();
855 let path = match path {
855 let path = match path {
856− Some(path) => helix_core::path::get_canonicalized_path(&path)?,
856+ Some(path) => helix_core::path::get_canonicalized_path(&path),
857 None => {
857 None => {
858 if self.path.is_none() {
858 if self.path.is_none() {
859 bail!("Can't save with no path set!");
859 bail!("Can't save with no path set!");
@@ -1047,18 +1047,14 @@ impl Document {
1047 self.encoding
1047 self.encoding
1050− pub fn set_path(&mut self, path: Option<&Path>) -> Result<(), std::io::Error> {
1050+ pub fn set_path(&mut self, path: Option<&Path>) {
1052− .map(helix_core::path::get_canonicalized_path)
1051+ let path = path.map(helix_core::path::get_canonicalized_path);
1055 // if parent doesn't exist we still want to open the document
1053 // if parent doesn't exist we still want to open the document
1056 // and error out when document is saved
1054 // and error out when document is saved
1057 self.path = path;
1055 self.path = path;
1059 self.detect_readonly();
1057 self.detect_readonly();
1064 /// Set the programming language for the file and load associated data (e.g. highlighting)
1060 /// Set the programming language for the file and load associated data (e.g. highlighting)