Browse Source

Rename Filter action to search

tags/alpha-0.6.0
Manos Pitsidianakis 2 years ago
parent
commit
bae083cc8f
Signed by untrusted user: epilys GPG Key ID: 73627C2F690DF710
  1. 6
      meli.1
  2. 2
      src/components/mail/listing.rs
  3. 11
      src/components/mail/listing/compact.rs
  4. 2
      src/components/mail/listing/conversations.rs
  5. 2
      src/components/mail/listing/plain.rs
  6. 6
      src/components/utilities.rs
  7. 12
      src/execute.rs
  8. 2
      src/execute/actions.rs

6
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.

2
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));

11
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

2
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;

2
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;
}

6
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));

12
src/execute.rs

@ -134,14 +134,14 @@ define_commands!([
);
)
},
{ tags: ["filter"],
desc: "filter <TERM>, filters list with given term",
{ tags: ["search"],
desc: "search <TERM>, searches list with given term",
parser:(
named!(filter<Action>,
named!(search<Action>,
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<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!(

2
src/execute/actions.rs

@ -43,7 +43,7 @@ pub enum ListingAction {
SetThreaded,
SetCompact,
SetConversations,
Filter(String),
Search(String),
SetSeen,
SetUnseen,
Delete,

Loading…
Cancel
Save