From c5ee8285ee17673b2fc6046333ed91f90afc723d Mon Sep 17 00:00:00 2001 From: l-const Date: Wed, 4 Sep 2024 00:40:51 +0300 Subject: [PATCH] Delete files in search-mode. (fix for #252) --- src/app.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index 87cbab7..9041498 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1696,6 +1696,11 @@ impl Application for App { commands.push(self.update_notification()); // Manually rescan any trash tabs after any operation is completed commands.push(self.rescan_trash()); + + // if search is active, update "search" tab view + if !self.search_input.is_empty() { + commands.push(self.search()); + } return Command::batch(commands); } Message::PendingError(id, err) => { @@ -1842,8 +1847,14 @@ impl Application for App { if let Some(tab) = self.tab_model.data::(entity) { self.activate_nav_model_location(&tab.location.clone()); } - - return self.update_title(); + let mut commands = vec![]; + commands.push(self.update_title()); + // if the tab was in an active search mode + // search again in case files were modified/deleted + if !self.search_input.is_empty() { + commands.push(self.search()); + } + return Command::batch(commands); } Message::TabNext => { let len = self.tab_model.iter().count();