Compare commits

...

1 Commits

Author SHA1 Message Date
Richard Feldman
106fca327b Actually write to the filesystem 2025-03-08 17:57:32 -05:00

View File

@@ -11,6 +11,7 @@ use project::{search::SearchQuery, Fs, Project};
use regex::Regex;
use std::{
cell::RefCell,
fs::File,
path::{Path, PathBuf},
sync::Arc,
};
@@ -495,6 +496,16 @@ impl Session {
let new_position = position + bytes.len();
file_userdata.set("__position", new_position)?;
match std::fs::write(path.clone(), &*content_vec) {
Ok(_) => (),
Err(e) => {
return Err(mlua::Error::runtime(format!(
"Failed to write to file on the actual filesytem: {}",
e
)));
}
}
// Update fs_changes
let path = file_userdata.get::<String>("__path")?;
let path_buf = PathBuf::from(path);