prepwork for #41

This commit is contained in:
2025-11-14 14:26:04 -07:00
parent 98215e42af
commit a03794e69f
3 changed files with 21 additions and 12 deletions

View File

@@ -1,7 +1,5 @@
use std::{
cmp::{max, min},
fmt::Display,
path::PathBuf,
cmp::{max, min}, fmt::Display, fs, path::PathBuf
};
use ratatui::{
@@ -83,6 +81,9 @@ impl Mode {
}
};
// TODO Check if the file exists, but the program wasn't opened with it. We might be accidentally overwriting something else.
// let mut file = fs::OpenOptions::new().write(true).append(false).truncate(true).create(true).open(path)?;
if let Err(e) = app.grid.save_to(&path) {
app.msg = StatusMessage::error(format!("{e}"));
} else {