diff --git a/Cargo.lock b/Cargo.lock index 208b87a0..b0d25681 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -683,6 +683,7 @@ name = "meli" version = "0.5.1" dependencies = [ "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs index 99bc7a84..547abdda 100644 --- a/src/components/mail/listing.rs +++ b/src/components/mail/listing.rs @@ -843,7 +843,7 @@ impl Component for Listing { return true; } UIEvent::Input(ref k) - if shortcut!(k == shortcuts[CompactListing::DESCRIPTION]["open_thread"]) => + if shortcut!(k == shortcuts[Listing::DESCRIPTION]["open_mailbox"]) => { self.cursor_pos = self.menu_cursor_pos; self.change_account(context); @@ -1058,7 +1058,10 @@ impl Component for Listing { fn get_shortcuts(&self, context: &Context) -> ShortcutMaps { let mut map = self.component.get_shortcuts(context); - let config_map = context.settings.shortcuts.listing.key_values(); + let mut config_map = context.settings.shortcuts.listing.key_values(); + if self.focus != ListingFocus::Menu { + config_map.remove("open_mailbox"); + } map.insert(Listing::DESCRIPTION, config_map); map diff --git a/src/conf/shortcuts.rs b/src/conf/shortcuts.rs index 03b6eb7d..dec44c39 100644 --- a/src/conf/shortcuts.rs +++ b/src/conf/shortcuts.rs @@ -132,6 +132,7 @@ shortcut_key_values! { "listing", next_page |> "Go to next page." |> Key::PageDown, prev_account |> "Go to previous account." |> Key::Char('l'), prev_mailbox |> "Go to previous mailbox." |> Key::Char('K'), + open_mailbox |> "Open selected mailbox" |> Key::Char('\n'), prev_page |> "Go to previous page." |> Key::PageUp, search |> "Search within list of e-mails." |> Key::Char('/'), refresh |> "Manually request a mailbox refresh." |> Key::F(5),