mirror of https://github.com/lapce/lapce.git
fix: don't overwrite permissions
This commit is contained in:
parent
8d13b30ec6
commit
2d07ebed7b
|
@ -65,6 +65,8 @@ pub fn save(&mut self, rev: u64) -> Result<()> {
|
|||
for chunk in self.rope.iter_chunks(..self.rope.len()) {
|
||||
f.write_all(chunk.as_bytes())?;
|
||||
}
|
||||
let perm = fs::metadata(&self.path)?.permissions();
|
||||
fs::set_permissions(tmp_path, perm)?;
|
||||
fs::rename(tmp_path, &self.path)?;
|
||||
self.mod_time = get_mod_time(&self.path);
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in New Issue