Skip to content

Commit 25c7d3f

Browse files
authored
Merge pull request #395 from joshheyse/josh/ctrl-fb-page-scroll
Support CTRL-f and CTRL-b for paging
2 parents 0925504 + 99e30b2 commit 25c7d3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/pagermode-viewing.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,15 @@ func (m PagerModeViewing) onRune(char rune) {
141141
case '>', 'G':
142142
p.scrollToEnd()
143143

144-
case 'f', ' ':
144+
// '\x06' = CTRL-f, should work like just 'f'.
145+
// Ref: https://github.com/walles/moor/issues/107
146+
case 'f', ' ', '\x06':
145147
p.scrollPosition = p.scrollPosition.NextLine(p.visibleHeight())
146148
p.handleScrolledDown()
147149

148-
case 'b':
150+
// '\x02' = CTRL-b, should work like just 'b'.
151+
// Ref: https://github.com/walles/moor/issues/107
152+
case 'b', '\x02':
149153
p.scrollPosition = p.scrollPosition.PreviousLine(p.visibleHeight())
150154
p.handleScrolledUp()
151155

0 commit comments

Comments
 (0)