Skip to content

Commit

Permalink
Support Home/End and fix inconsistent help text
Browse files Browse the repository at this point in the history
  • Loading branch information
kidonng authored and Byron committed Aug 22, 2021
1 parent 8977c17 commit 29017f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/interactive/app/eventloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ impl AppState {
Char('o') | Char('l') | Char('\n') | Right => {
self.enter_node_with_traversal(traversal)
}
Char('H') => self.change_entry_selection(CursorDirection::ToTop),
Char('G') => self.change_entry_selection(CursorDirection::ToBottom),
Char('H') | Home => self.change_entry_selection(CursorDirection::ToTop),
Char('G') | End => self.change_entry_selection(CursorDirection::ToBottom),
Ctrl('u') | PageUp => self.change_entry_selection(CursorDirection::PageUp),
Char('k') | Up => self.change_entry_selection(CursorDirection::Up),
Char('j') | Down => self.change_entry_selection(CursorDirection::Down),
Expand Down
2 changes: 1 addition & 1 deletion src/interactive/widgets/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Entries {
list.render(props, lines, area, buf);

if *is_focussed {
let help_text = " . = o|.. = u ── ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
let help_text = " . = o|.. = u ── ⇊ = Ctrl+d|↓ = j|⇈ = Ctrl+u|↑ = k ";
let help_text_block_width = block_width(help_text);
let bound = Rect {
width: area.width.saturating_sub(1),
Expand Down
26 changes: 13 additions & 13 deletions src/interactive/widgets/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,32 +98,32 @@ impl HelpPane {
title("Keys for pane control");
{
hotkey(
"q/<ESC>",
"q/<Esc>",
"Close the current pane. Closes the program if no",
Some("pane is open"),
);
hotkey("<tab>", "Cycle between all open panes", None);
hotkey("<Tab>", "Cycle between all open panes", None);
hotkey("?", "Show or hide the help pane", None);
spacer();
}
title("Keys for Navigation");
{
hotkey("j/<down>", "move down an entry", None);
hotkey("k/<up>", "move up an entry", None);
hotkey("o/l/<enter>", "descent into the selected directory", None);
hotkey("<right>", "^", None);
hotkey("j/<Down>", "move down an entry", None);
hotkey("k/<Up>", "move up an entry", None);
hotkey("o/l/<Enter>", "descent into the selected directory", None);
hotkey("<Right>", "^", None);
hotkey(
"u/h/<left>",
"u/h/<Left>",
"ascent one level into the parent directory",
None,
);
hotkey("<backspace>", "^", None);
hotkey("<Backspace>", "^", None);
hotkey("Ctrl + d", "move down 10 entries at once", None);
hotkey("<Page Down>", "^", None);
hotkey("Ctrl + u", "move up 10 entries at once", None);
hotkey("<Page Up>", "^", None);
hotkey("H", "Move to the top of the entries list", None);
hotkey("G", "Move to the bottom of the entries list", None);
hotkey("H/<Home>", "Move to the top of the entries list", None);
hotkey("G/<End>", "Move to the bottom of the entries list", None);
spacer();
}
title("Keys for display");
Expand Down Expand Up @@ -153,13 +153,13 @@ impl HelpPane {
"Mark for the currently selected entry for deletion and move down",
None,
);
hotkey("<space bar>", "Toggle the currently selected entry", None);
hotkey("<Space>", "Toggle the currently selected entry", None);
spacer();
}
title("Keys in the Mark pane");
{
hotkey(
"x/d/<space>",
"x/d/<Space>",
"remove the selected entry from the list",
None,
);
Expand Down Expand Up @@ -202,7 +202,7 @@ impl HelpPane {
block.render(area, buf);

if *has_focus {
let help_text = " . = o|.. = u || ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
let help_text = " . = o|.. = u ── ⇊ = Ctrl+d|↓ = j|⇈ = Ctrl+u|↑ = k ";
let help_text_block_width = block_width(help_text);
let bound = Rect {
width: area.width.saturating_sub(1),
Expand Down
2 changes: 1 addition & 1 deletion src/interactive/widgets/mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl MarkPane {
self.list.render(props, entries, list_area, buf);

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

0 comments on commit 29017f6

Please sign in to comment.