Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29017f6

Browse files
kidonngByron
authored andcommitted
Support Home/End and fix inconsistent help text
1 parent 8977c17 commit 29017f6

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/interactive/app/eventloop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ impl AppState {
142142
Char('o') | Char('l') | Char('\n') | Right => {
143143
self.enter_node_with_traversal(traversal)
144144
}
145-
Char('H') => self.change_entry_selection(CursorDirection::ToTop),
146-
Char('G') => self.change_entry_selection(CursorDirection::ToBottom),
145+
Char('H') | Home => self.change_entry_selection(CursorDirection::ToTop),
146+
Char('G') | End => self.change_entry_selection(CursorDirection::ToBottom),
147147
Ctrl('u') | PageUp => self.change_entry_selection(CursorDirection::PageUp),
148148
Char('k') | Up => self.change_entry_selection(CursorDirection::Up),
149149
Char('j') | Down => self.change_entry_selection(CursorDirection::Down),

src/interactive/widgets/entries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl Entries {
167167
list.render(props, lines, area, buf);
168168

169169
if *is_focussed {
170-
let help_text = " . = o|.. = u ── ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
170+
let help_text = " . = o|.. = u ── ⇊ = Ctrl+d|↓ = j|⇈ = Ctrl+u|↑ = k ";
171171
let help_text_block_width = block_width(help_text);
172172
let bound = Rect {
173173
width: area.width.saturating_sub(1),

src/interactive/widgets/help.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,32 +98,32 @@ impl HelpPane {
9898
title("Keys for pane control");
9999
{
100100
hotkey(
101-
"q/<ESC>",
101+
"q/<Esc>",
102102
"Close the current pane. Closes the program if no",
103103
Some("pane is open"),
104104
);
105-
hotkey("<tab>", "Cycle between all open panes", None);
105+
hotkey("<Tab>", "Cycle between all open panes", None);
106106
hotkey("?", "Show or hide the help pane", None);
107107
spacer();
108108
}
109109
title("Keys for Navigation");
110110
{
111-
hotkey("j/<down>", "move down an entry", None);
112-
hotkey("k/<up>", "move up an entry", None);
113-
hotkey("o/l/<enter>", "descent into the selected directory", None);
114-
hotkey("<right>", "^", None);
111+
hotkey("j/<Down>", "move down an entry", None);
112+
hotkey("k/<Up>", "move up an entry", None);
113+
hotkey("o/l/<Enter>", "descent into the selected directory", None);
114+
hotkey("<Right>", "^", None);
115115
hotkey(
116-
"u/h/<left>",
116+
"u/h/<Left>",
117117
"ascent one level into the parent directory",
118118
None,
119119
);
120-
hotkey("<backspace>", "^", None);
120+
hotkey("<Backspace>", "^", None);
121121
hotkey("Ctrl + d", "move down 10 entries at once", None);
122122
hotkey("<Page Down>", "^", None);
123123
hotkey("Ctrl + u", "move up 10 entries at once", None);
124124
hotkey("<Page Up>", "^", None);
125-
hotkey("H", "Move to the top of the entries list", None);
126-
hotkey("G", "Move to the bottom of the entries list", None);
125+
hotkey("H/<Home>", "Move to the top of the entries list", None);
126+
hotkey("G/<End>", "Move to the bottom of the entries list", None);
127127
spacer();
128128
}
129129
title("Keys for display");
@@ -153,13 +153,13 @@ impl HelpPane {
153153
"Mark for the currently selected entry for deletion and move down",
154154
None,
155155
);
156-
hotkey("<space bar>", "Toggle the currently selected entry", None);
156+
hotkey("<Space>", "Toggle the currently selected entry", None);
157157
spacer();
158158
}
159159
title("Keys in the Mark pane");
160160
{
161161
hotkey(
162-
"x/d/<space>",
162+
"x/d/<Space>",
163163
"remove the selected entry from the list",
164164
None,
165165
);
@@ -202,7 +202,7 @@ impl HelpPane {
202202
block.render(area, buf);
203203

204204
if *has_focus {
205-
let help_text = " . = o|.. = u || ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
205+
let help_text = " . = o|.. = u ── ⇊ = Ctrl+d|↓ = j|⇈ = Ctrl+u|↑ = k ";
206206
let help_text_block_width = block_width(help_text);
207207
let bound = Rect {
208208
width: area.width.saturating_sub(1),

src/interactive/widgets/mark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl MarkPane {
397397
self.list.render(props, entries, list_area, buf);
398398

399399
if has_focus {
400-
let help_text = " . = o|.. = u ── ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
400+
let help_text = " . = o|.. = u ── ⇊ = Ctrl+d|↓ = j|⇈ = Ctrl+u|↑ = k ";
401401
let help_text_block_width = block_width(help_text);
402402
let bound = Rect {
403403
width: area.width.saturating_sub(1),

0 commit comments

Comments
 (0)