Skip to content

Commit 2f266c1

Browse files
authored
Merge pull request #162 from MitMaro/tim/visual-mode-help
Add visual mode to help
2 parents 4e868e7 + 8c56a7f commit 2f266c1

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/help/help.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ use crate::window::WindowColor;
1212
use crate::Config;
1313

1414
pub struct Help<'h> {
15-
normal_mode_help_lines: [(String, &'h str); 21],
15+
normal_mode_help_lines: [(String, &'h str); 22],
1616
normal_mode_max_help_line_length: usize,
1717
return_state: State,
1818
scroll_position: ScrollPosition,
19-
visual_mode_help_lines: [(String, &'h str); 13],
19+
visual_mode_help_lines: [(String, &'h str); 14],
2020
visual_mode_max_help_line_length: usize,
2121
}
2222

src/help/utils.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn get_input_short_name(input: &str) -> String {
1919
}
2020
}
2121

22-
pub fn get_list_normal_mode_help_lines(config: &Config) -> [(String, &str); 21] {
22+
pub fn get_list_normal_mode_help_lines(config: &Config) -> [(String, &str); 22] {
2323
[
2424
(get_input_short_name(config.input_move_up.as_str()), "Move selection up"),
2525
(
@@ -50,6 +50,10 @@ pub fn get_list_normal_mode_help_lines(config: &Config) -> [(String, &str); 21]
5050
get_input_short_name(config.input_force_rebase.as_str()),
5151
"Immediately write interactive rebase file",
5252
),
53+
(
54+
get_input_short_name(config.input_toggle_visual_mode.as_str()),
55+
"Enter visual mode",
56+
),
5357
(get_input_short_name(config.input_help.as_str()), "Show help"),
5458
(
5559
get_input_short_name(config.input_show_commit.as_str()),
@@ -102,7 +106,7 @@ pub fn get_list_normal_mode_help_lines(config: &Config) -> [(String, &str); 21]
102106
]
103107
}
104108

105-
pub fn get_list_visual_mode_help_lines(config: &Config) -> [(String, &str); 13] {
109+
pub fn get_list_visual_mode_help_lines(config: &Config) -> [(String, &str); 14] {
106110
[
107111
(get_input_short_name(config.input_move_up.as_str()), "Move selection up"),
108112
(
@@ -150,6 +154,10 @@ pub fn get_list_visual_mode_help_lines(config: &Config) -> [(String, &str); 13]
150154
get_input_short_name(config.input_action_drop.as_str()),
151155
"Set selected commits to be dropped",
152156
),
157+
(
158+
get_input_short_name(config.input_toggle_visual_mode.as_str()),
159+
"Exit visual mode",
160+
),
153161
]
154162
}
155163

0 commit comments

Comments
 (0)