From 85c5875689e91a8c7888f11217b9fe94e2d9fa71 Mon Sep 17 00:00:00 2001
From: Joe <rbo@gmx.us>
Date: Mon, 13 May 2024 20:20:20 +0200
Subject: go

---
 src/c_defs.go | 36 +++++++++++++++++++++++-------------
 src/e_keys.go |  3 ++-
 src/i_help.go |  8 +++++---
 3 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/src/c_defs.go b/src/c_defs.go
index 22f169d..5191c6d 100644
--- a/src/c_defs.go
+++ b/src/c_defs.go
@@ -43,7 +43,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *
  * hardflip: src/c_defs.go
- * Wed Apr 24 15:11:37 2024
+ * Mon May 13 10:27:54 2024
  * Joe
  *
  * constants
@@ -180,18 +180,28 @@ const (
 
 var (
 	HELP_NORMAL_KEYS = [][2]string{
-	{"<down> | j",	"Select next item"},
-	{"<up> | k",	"Select previous item"},
-	{"[Enter]",		"Connect to selected host / toggle directory"},
-	{"a | i",		"Create a new host"},
-	{"y",			"Copy selected host"},
-	{"d",			"Cut selected host"},
-	{"p",			"Paste host in clipboard"},
-	{"m",			"Create a new directory"},
-	{"e",			"Edit selected host"},
-	{"c",			"Rename selected item"},
-	{"g",			"Go to first item"},
-	{"G",			"Go to last item"},
+	{"<down> | j",			"Go to next item"},
+	{"<up> | k",			"Go to previous item"},
+	{"<pgdown> | <c-d>",	"Jump down"},
+	{"<pgup> | <c-u>",	 	"Jump up"},
+	{"} | ]",				"Go to next directory"},
+	{"{ | [",				"Go to previous directory"},
+	{"g",					"Go to first item"},
+	{"G",					"Go to last item"},
+	{"D",					"Delete selected item"},
+	{"h",					"Close current directory"},
+	{"H",					"Close all directories"},
+	{"l | <space>",			"Toggle directory"},
+	{"l | <enter>",			"Connect to selected host / toggle directory"},
+	{"a | i",				"Create a new host"},
+	{"y",					"Copy selected host"},
+	{"d",					"Cut selected host"},
+	{"p",					"Paste host in clipboard"},
+	{"<f7> | m",					"Create a new directory"},
+	{"e",					"Edit selected host"},
+	{"c | C | A",			"Rename selected item"},
+	{"?",					"Display this help menu"},
+	{"<c-c> | q",			"Quit"},
 	}
 )
 
diff --git a/src/e_keys.go b/src/e_keys.go
index af19547..f995e0a 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -835,7 +835,8 @@ func e_rename_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
 func e_help_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
 	if event.Key() == tcell.KeyEscape ||
 	   event.Key() == tcell.KeyCtrlC ||
-	   event.Rune() == 'q' {
+	   event.Rune() == 'q' ||
+	   event.Rune() == '?' {
 		ui.mode = NORMAL_MODE
 		ui.help_scroll = 0
 		return true
diff --git a/src/i_help.go b/src/i_help.go
index cd8a5bd..c022012 100644
--- a/src/i_help.go
+++ b/src/i_help.go
@@ -80,6 +80,7 @@ func i_draw_help(ui *HardUI) {
 }
 
 func i_help_normal(ui HardUI, win Quad, line *int) bool {
+	delim := 17
 	for _, v := range HELP_NORMAL_KEYS {
 		if *line < 0 {
 			*line += 1
@@ -87,10 +88,11 @@ func i_help_normal(ui HardUI, win Quad, line *int) bool {
 		} else if win.T + *line + 1 >= win.B {
 			return false
 		}
-		i := 13 - len(v[0])
-		i_draw_text(ui.s, win.L + 1 + i, win.T + 1 + *line, win.L + 14,
+		i := delim - 1 - len(v[0])
+		if i < 0 { i = 0 }
+		i_draw_text(ui.s, win.L + 1 + i, win.T + 1 + *line, win.L + delim,
 			win.T + 1 + *line, ui.style[BOT_STYLE], v[0])
-		i_draw_text(ui.s, win.L + 15,    win.T + 1 + *line, win.R - 1,
+		i_draw_text(ui.s, win.L + delim + 1, win.T + 1 + *line, win.R,
 			win.T + 1 +  *line, ui.style[DEF_STYLE], v[1])
 		*line += 1
 	}
-- 
cgit v1.2.3