summaryrefslogtreecommitdiffstats
path: root/src/interactive/widgets/help.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-04 17:00:30 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-04 17:01:35 +0530
commit5ece6f74eaa5cbfbc5205f4f7ad486e6ad6c410f (patch)
tree02e88e0953394fee2ac2415ba1d7636fb2c8d0bf /src/interactive/widgets/help.rs
parent2b2bd4ea9a848d5e79ad5cc630fd86b1df2c93fd (diff)
The reamining hotkeys explained
Diffstat (limited to 'src/interactive/widgets/help.rs')
-rw-r--r--src/interactive/widgets/help.rs34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/interactive/widgets/help.rs b/src/interactive/widgets/help.rs
index 0d8628f..2d867ee 100644
--- a/src/interactive/widgets/help.rs
+++ b/src/interactive/widgets/help.rs
@@ -16,14 +16,17 @@ pub struct HelpPane {
impl Widget for HelpPane {
fn draw(&mut self, area: Rect, buf: &mut Buffer) {
- fn title(name: &str) -> Text {
- Text::Styled(
+ fn spacer() -> [Text<'static>; 1] {
+ [Text::Raw("\n\n".into())]
+ };
+ fn title(name: &str) -> [Text<'static>; 1] {
+ [Text::Styled(
format!("{}\n\n", name).into(),
Style {
modifier: Modifier::BOLD | Modifier::UNDERLINED,
..Default::default()
},
- )
+ )]
};
fn hotkey(keys: &str, description: &str) -> [Text<'static>; 2] {
[
@@ -46,14 +49,35 @@ impl Widget for HelpPane {
let area = block.inner(area).inner(1);
Paragraph::new(
- [title("Keys for Navigation")]
+ title("Keys for Navigation")
.iter()
.chain(hotkey("j", "move down an entry").iter())
.chain(hotkey("k", "move up an entry").iter())
.chain(hotkey("o", "descent into the selected directory").iter())
.chain(hotkey("u", "move up one level into the parent directory").iter())
.chain(hotkey("Ctrl + d", "move down 10 entries at once").iter())
- .chain(hotkey("Ctrl + u", "move up 10 entries at once").iter()),
+ .chain(hotkey("Ctrl + u", "move up 10 entries at once").iter())
+ .chain(spacer().iter())
+ .chain(
+ title("Keys for sorting")
+ .iter()
+ .chain(hotkey("s", "toggle sort by size ascending/descending").iter())
+ .chain(spacer().iter())
+ )
+ .chain(
+ title("Keys for entry operations")
+ .iter()
+ .chain(hotkey("Shift + o", "Open the entry with the associated program").iter())
+ .chain(spacer().iter())
+ )
+ .chain(
+ title("Keys for application control")
+ .iter()
+ .chain(hotkey("q", "close the current pain. Closes the application if no pane is open.").iter())
+ .chain(hotkey("Ctrl + c", "close the application. No questions asked!").iter())
+ .chain(hotkey("?", "Show this help pane").iter())
+ .chain(spacer().iter())
+ )
)
.draw(area, buf);
}