From 7462943c0447fb575092219c2b15fa3b08393c65 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sat, 21 Feb 2026 05:30:34 -0600 Subject: [PATCH] feat: display save indicator on new files --- src/file.rs | 2 +- src/state.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/file.rs b/src/file.rs index 371ca90..1570a20 100644 --- a/src/file.rs +++ b/src/file.rs @@ -15,7 +15,7 @@ pub struct File { impl Default for File { fn default() -> Self { File { - needs_saving: false, + needs_saving: true, content: text_editor::Content::new(), path: None, markdown: Vec::new(), diff --git a/src/state.rs b/src/state.rs index d30bfe5..1e852fd 100644 --- a/src/state.rs +++ b/src/state.rs @@ -75,6 +75,7 @@ impl State { pub fn open_file(&mut self, path: PathBuf, content: String) { if let Some(index) = self.files.iter().position(|f| f.path() == Some(&path)) { self.files[index].set_content(&content); + self.files[index].set_needs_saving(false); self.current_file = index; return; }