Allow toggle_help (default ?) remapping

This commit is contained in:
Manos Pitsidianakis 2020-08-25 15:48:38 +03:00
parent 53e924eb33
commit 629997397f
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710
3 changed files with 6 additions and 1 deletions

View File

@ -456,6 +456,10 @@ exit_thread = 'i'
.Pp
.Em general
.Bl -tag -width 36n
.It Ic toggle_help
Toggle help and shortcuts view.
.\" default value
.Pq Em \&?
.It Ic enter_command_mode
Enter
.Em COMMAND

View File

@ -1653,7 +1653,7 @@ impl Component for Tabbed {
self.set_dirty(true);
return true;
}
UIEvent::Input(Key::Char('?')) => {
UIEvent::Input(ref key) if shortcut!(key == shortcuts["general"]["toggle_help"]) => {
if self.show_shortcuts {
/* children below the shortcut overlay must be redrawn */
self.set_dirty(true);

View File

@ -211,6 +211,7 @@ shortcut_key_values! { "pager",
shortcut_key_values! { "general",
pub struct GeneralShortcuts {
toggle_help |> "Toggle help and shortcuts view." |> Key::Char('?'),
enter_command_mode |> "Enter COMMAND mode." |> Key::Char(' '),
go_to_tab |> "Go to the nth tab" |> Key::Alt('n'),
next_tab |> "Next tab." |> Key::Char('T'),