From bae083cc8f072136ff29173c88b800bc8487d89e Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Wed, 26 Feb 2020 18:36:52 +0200 Subject: [PATCH] Rename Filter action to search --- meli.1 | 6 +++--- src/components/mail/listing.rs | 2 +- src/components/mail/listing/compact.rs | 11 ++++------- src/components/mail/listing/conversations.rs | 2 +- src/components/mail/listing/plain.rs | 2 +- src/components/utilities.rs | 6 +++--- src/execute.rs | 12 ++++++------ src/execute/actions.rs | 2 +- 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/meli.1 b/meli.1 index c5a8eef9a..2a9b98128 100644 --- a/meli.1 +++ b/meli.1 @@ -301,11 +301,11 @@ is a mailbox prefixed with the number in the side menu for the current account .It Cm toggle_thread_snooze don't issue notifications for thread under cursor in thread listing -.It Cm filter Ar STRING -filter mailbox with +.It Cm search Ar STRING +search mailbox with .Ar STRING key. -Escape exits filter results +Escape exits search results .It Cm set read, set unread .It Cm create-mailbox Ar ACCOUNT Ar MAILBOX_PATH create mailbox with given path. diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs index 6656402b1..7ff6309a7 100644 --- a/src/components/mail/listing.rs +++ b/src/components/mail/listing.rs @@ -773,7 +773,7 @@ impl Component for Listing { { context .replies - .push_back(UIEvent::ExInput(Key::Paste("filter ".to_string()))); + .push_back(UIEvent::ExInput(Key::Paste("search ".to_string()))); context .replies .push_back(UIEvent::ChangeMode(UIMode::Execute)); diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs index 58eaebe4f..00132b3a9 100644 --- a/src/components/mail/listing/compact.rs +++ b/src/components/mail/listing/compact.rs @@ -1354,13 +1354,10 @@ impl Component for CompactListing { self.set_dirty(true); return true; } - UIEvent::Action(ref action) => match action { - Action::Listing(Filter(ref filter_term)) if !self.unfocused => { - self.filter(filter_term, context); - self.dirty = true; - } - _ => {} - }, + UIEvent::Action(Action::Listing(Search(ref filter_term))) if !self.unfocused => { + self.filter(filter_term, context); + self.dirty = true; + } _ => {} } false diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs index 2b45afd68..ef270836d 100644 --- a/src/components/mail/listing/conversations.rs +++ b/src/components/mail/listing/conversations.rs @@ -1291,7 +1291,7 @@ impl Component for ConversationsListing { self.dirty = true; } UIEvent::Action(ref action) => match action { - Action::Listing(Filter(ref filter_term)) if !self.unfocused => { + Action::Listing(Search(ref filter_term)) if !self.unfocused => { self.filter(filter_term, context); self.dirty = true; return true; diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs index 03181ffbf..cffc7c35c 100644 --- a/src/components/mail/listing/plain.rs +++ b/src/components/mail/listing/plain.rs @@ -1180,7 +1180,7 @@ impl Component for PlainListing { self.refresh_mailbox(context, false); return true; } - UIEvent::Action(Action::Listing(Filter(ref filter_term))) if !self.unfocused => { + UIEvent::Action(Action::Listing(Search(ref filter_term))) if !self.unfocused => { self.filter(filter_term, context); self.dirty = true; } diff --git a/src/components/utilities.rs b/src/components/utilities.rs index 20696a7cd..9e7bfccf0 100644 --- a/src/components/utilities.rs +++ b/src/components/utilities.rs @@ -755,7 +755,7 @@ impl Component for Pager { )))); return true; } - UIEvent::Action(Action::Listing(ListingAction::Filter(pattern))) => { + UIEvent::Action(Action::Listing(ListingAction::Search(pattern))) => { self.search = Some(SearchPattern { pattern: pattern.to_string(), positions: vec![], @@ -1962,7 +1962,7 @@ impl Component for Tabbed { ); } } - UIEvent::Action(Action::Listing(ListingAction::Filter(pattern))) + UIEvent::Action(Action::Listing(ListingAction::Search(pattern))) if self.show_shortcuts => { self.help_search = Some(SearchPattern { @@ -2014,7 +2014,7 @@ impl Component for Tabbed { { context .replies - .push_back(UIEvent::ExInput(Key::Paste("filter ".to_string()))); + .push_back(UIEvent::ExInput(Key::Paste("search ".to_string()))); context .replies .push_back(UIEvent::ChangeMode(UIMode::Execute)); diff --git a/src/execute.rs b/src/execute.rs index d885f5b4b..6678b6929 100644 --- a/src/execute.rs +++ b/src/execute.rs @@ -134,14 +134,14 @@ define_commands!([ ); ) }, - { tags: ["filter"], - desc: "filter , filters list with given term", + { tags: ["search"], + desc: "search , searches list with given term", parser:( - named!(filter, + named!(search, do_parse!( - ws!(tag!("filter")) + ws!(tag!("search")) >> string: map_res!(call!(not_line_ending), std::str::from_utf8) - >> (Listing(Filter(String::from(string)))) + >> (Listing(Search(String::from(string)))) ) ); ) @@ -424,7 +424,7 @@ named!( named!( listing_action, - alt_complete!(toggle | envelope_action | filter | toggle_thread_snooze | open_in_new_tab | tag) + alt_complete!(toggle | envelope_action | search | toggle_thread_snooze | open_in_new_tab | tag) ); named!( diff --git a/src/execute/actions.rs b/src/execute/actions.rs index 9582b5342..cdb339c47 100644 --- a/src/execute/actions.rs +++ b/src/execute/actions.rs @@ -43,7 +43,7 @@ pub enum ListingAction { SetThreaded, SetCompact, SetConversations, - Filter(String), + Search(String), SetSeen, SetUnseen, Delete,