diff --git a/docs/meli.conf.5 b/docs/meli.conf.5 index 68683178..6b94fb42 100644 --- a/docs/meli.conf.5 +++ b/docs/meli.conf.5 @@ -609,6 +609,14 @@ Go to the .Em n Ns th tab .Pq Em cannot be redefined +.It Ic info_message_next +Show next info message, if any +.\" default value +.Pq Ql Em M-> +.It Ic info_message_previous +Show previous info message, if any +.\" default value +.Pq Ql Em M-< .El .sp .Em listing diff --git a/src/conf/shortcuts.rs b/src/conf/shortcuts.rs index a3501e53..6189d8d1 100644 --- a/src/conf/shortcuts.rs +++ b/src/conf/shortcuts.rs @@ -222,7 +222,9 @@ shortcut_key_values! { "general", scroll_right |> "Generic scroll right (catch-all setting)" |> Key::Right, scroll_left |> "Generic scroll left (catch-all setting)" |> Key::Left, scroll_up |> "Generic scroll up (catch-all setting)" |> Key::Char('k'), - scroll_down |> "Generic scroll down (catch-all setting)" |> Key::Char('j') + scroll_down |> "Generic scroll down (catch-all setting)" |> Key::Char('j'), + info_message_next |> "Show next info message, if any" |> Key::Alt('>'), + info_message_previous |> "Show previous info message, if any" |> Key::Alt('<') } } diff --git a/src/state.rs b/src/state.rs index 50756773..f6339566 100644 --- a/src/state.rs +++ b/src/state.rs @@ -700,12 +700,30 @@ impl State { if self.display_messages.len() > 1 { write_string_to_grid( - if self.display_messages_pos == 0 { - "Next: >" + &if self.display_messages_pos == 0 { + format!( + "Next: {}", + self.context.settings.shortcuts.general.info_message_next + ) } else if self.display_messages_pos + 1 == self.display_messages.len() { - "Prev: <" + format!( + "Prev: {}", + self.context + .settings + .shortcuts + .general + .info_message_previous + ) } else { - "Prev: <, Next: >" + format!( + "Prev: {} Next: {}", + self.context + .settings + .shortcuts + .general + .info_message_previous, + self.context.settings.shortcuts.general.info_message_next + ) }, &mut self.overlay_grid, noto_colors.fg, @@ -1174,7 +1192,15 @@ impl State { self.redraw(); return; } - UIEvent::Input(Key::Alt('<')) => { + UIEvent::Input(ref key) + if *key + == self + .context + .settings + .shortcuts + .general + .info_message_previous => + { self.display_messages_expiration_start = Some(melib::datetime::now()); self.display_messages_active = true; self.display_messages_initialised = false; @@ -1182,7 +1208,9 @@ impl State { self.display_messages_pos = self.display_messages_pos.saturating_sub(1); return; } - UIEvent::Input(Key::Alt('>')) => { + UIEvent::Input(ref key) + if *key == self.context.settings.shortcuts.general.info_message_next => + { self.display_messages_expiration_start = Some(melib::datetime::now()); self.display_messages_active = true; self.display_messages_initialised = false;