Bind N to navigate to previous slide (#238)

This commit is contained in:
Uzair Ahmad
2023-04-20 23:49:36 -04:00
committed by GitHub
parent 77e7a9e414
commit bc5fb8b40f
3 changed files with 3 additions and 1 deletions

View File

@@ -142,6 +142,7 @@ Go to the previous slide with any of the following key sequences:
* <kbd>p</kbd>
* <kbd>h</kbd>
* <kbd>k</kbd>
* <kbd>N</kbd>
* <kbd>Page Up</kbd>
* number + any of the above (go back n slides)

View File

@@ -57,7 +57,7 @@ func Navigate(state State, keyPress string) State {
Page: navigateNext(state),
TotalSlides: state.TotalSlides,
}
case "up", "k", "left", "h", "p", "pgup":
case "up", "k", "left", "h", "p", "pgup", "N":
return State{
Page: navigatePrevious(state),
TotalSlides: state.TotalSlides,

View File

@@ -25,6 +25,7 @@ func TestNavigation(t *testing.T) {
{keys: "3G", target: 2},
{keys: "11G", target: 10},
{keys: "101G", target: 10},
{keys: "nnN", target: 1},
}
for _, tt := range tests {