mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-22 16:14:17 +02:00
Also use f and b to change pages in the file listing view
This commit is contained in:
parent
fc2f05626e
commit
f611b6e71f
1 changed files with 12 additions and 0 deletions
12
ui/stash.go
12
ui/stash.go
|
|
@ -364,6 +364,18 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
m.paginator = newPaginatorModel
|
||||
cmds = append(cmds, cmd)
|
||||
|
||||
// Extra paginator keystrokes
|
||||
if key, ok := msg.(tea.KeyMsg); ok {
|
||||
if key.Type == tea.KeyRune {
|
||||
switch key.Rune {
|
||||
case 'b':
|
||||
m.paginator.PrevPage()
|
||||
case 'f':
|
||||
m.paginator.NextPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Keep the index in bounds when paginating
|
||||
itemsOnPage := m.paginator.ItemsOnPage(len(m.markdowns))
|
||||
if m.index > itemsOnPage-1 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue