commit 4d118f4

Gregory Anders  ·  2022-05-10 01:30:00 +0000 UTC
parent df65b98
Add support for standard readline bindings for C-a and C-e

Use Ctrl-A and Ctrl-E to move to the beginning/end of the input line

Fixes: https://todo.sr.ht/~taiite/senpai/124
2 files changed,  +10, -0
M app.go
M app.go
+4, -0
 1@@ -571,6 +571,10 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
 2 		} else {
 3 			app.win.InputSet("/quit")
 4 		}
 5+	case tcell.KeyCtrlA:
 6+		app.win.InputHome()
 7+	case tcell.KeyCtrlE:
 8+		app.win.InputEnd()
 9 	case tcell.KeyCtrlL:
10 		app.win.Resize()
11 	case tcell.KeyCtrlU, tcell.KeyPgUp:
+6, -0
 1@@ -76,6 +76,12 @@ senpai eats these events for eg selecting channels.*
 2 
 3 # KEYBOARD SHORTCUTS
 4 
 5+*CTRL-A*
 6+	Move the cursor to the beginning of the input field.
 7+
 8+*CTRL-E*
 9+	Move the cursor to the end of the input field.
10+
11 *CTRL-C*
12 	Clear input line.
13