mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-04-19 13:03:44 +03:00
Use pgup/pgdown as default paginator keystrokes
This commit is contained in:
parent
88469a499e
commit
5a26cb0d8e
@ -28,6 +28,7 @@ type Model struct {
|
|||||||
ActiveDot string
|
ActiveDot string
|
||||||
InactiveDot string
|
InactiveDot string
|
||||||
ArabicFormat string
|
ArabicFormat string
|
||||||
|
UsePgUpPgDownKeys bool
|
||||||
UseLeftRightKeys bool
|
UseLeftRightKeys bool
|
||||||
UseUpDownKeys bool
|
UseUpDownKeys bool
|
||||||
UseHLKeys bool
|
UseHLKeys bool
|
||||||
@ -105,6 +106,7 @@ func NewModel() Model {
|
|||||||
ActiveDot: "•",
|
ActiveDot: "•",
|
||||||
InactiveDot: "○",
|
InactiveDot: "○",
|
||||||
ArabicFormat: "%d/%d",
|
ArabicFormat: "%d/%d",
|
||||||
|
UsePgUpPgDownKeys: true,
|
||||||
UseLeftRightKeys: true,
|
UseLeftRightKeys: true,
|
||||||
UseUpDownKeys: false,
|
UseUpDownKeys: false,
|
||||||
UseHLKeys: true,
|
UseHLKeys: true,
|
||||||
@ -116,6 +118,14 @@ func NewModel() Model {
|
|||||||
func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case tea.KeyMsg:
|
case tea.KeyMsg:
|
||||||
|
if m.UsePgUpPgDownKeys {
|
||||||
|
switch msg.String() {
|
||||||
|
case "pgup":
|
||||||
|
m.PrevPage()
|
||||||
|
case "pgdown":
|
||||||
|
m.NextPage()
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.UseLeftRightKeys {
|
if m.UseLeftRightKeys {
|
||||||
switch msg.String() {
|
switch msg.String() {
|
||||||
case "left":
|
case "left":
|
||||||
|
Loading…
Reference in New Issue
Block a user