Use pgup/pgdown as default paginator keystrokes

This commit is contained in:
Christian Rocha 2020-07-20 12:13:33 -04:00
parent 88469a499e
commit 5a26cb0d8e
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018

View File

@ -28,6 +28,7 @@ type Model struct {
ActiveDot string
InactiveDot string
ArabicFormat string
UsePgUpPgDownKeys bool
UseLeftRightKeys bool
UseUpDownKeys bool
UseHLKeys bool
@ -105,6 +106,7 @@ func NewModel() Model {
ActiveDot: "•",
InactiveDot: "○",
ArabicFormat: "%d/%d",
UsePgUpPgDownKeys: true,
UseLeftRightKeys: true,
UseUpDownKeys: false,
UseHLKeys: true,
@ -116,6 +118,14 @@ func NewModel() Model {
func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
if m.UsePgUpPgDownKeys {
switch msg.String() {
case "pgup":
m.PrevPage()
case "pgdown":
m.NextPage()
}
}
if m.UseLeftRightKeys {
switch msg.String() {
case "left":