From c5db063f6afc3a7f2df555ae2c70cc0237881070 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Sun, 10 Mar 2024 01:23:26 -0500 Subject: [PATCH] Trigger reload on modified modified time Fixes: #67 --- src/app.rs | 13 +++++++++---- src/dialog.rs | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/app.rs b/src/app.rs index f2fc705..107c0d6 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1466,13 +1466,18 @@ impl Application for App { move |event_res: Result| match event_res { Ok(event) => { match &event.kind { - notify::EventKind::Access(_) - | notify::EventKind::Modify( - notify::event::ModifyKind::Metadata(_), - ) => { + notify::EventKind::Access(_) => { // Data not mutated return; } + notify::EventKind::Modify( + notify::event::ModifyKind::Metadata(e), + ) if (*e != notify::event::MetadataKind::Any + && *e != notify::event::MetadataKind::WriteTime) => + { + // Data not mutated nor modify time changed + return; + } _ => {} } diff --git a/src/dialog.rs b/src/dialog.rs index 727c2fd..a9586ab 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -666,13 +666,18 @@ impl Application for App { move |event_res: Result| match event_res { Ok(event) => { match &event.kind { - notify::EventKind::Access(_) - | notify::EventKind::Modify( - notify::event::ModifyKind::Metadata(_), - ) => { + notify::EventKind::Access(_) => { // Data not mutated return; } + notify::EventKind::Modify( + notify::event::ModifyKind::Metadata(e), + ) if (*e != notify::event::MetadataKind::Any + && *e != notify::event::MetadataKind::WriteTime) => + { + // Data not mutated nor modify time changed + return; + } _ => {} }