mirror of
https://github.com/maaslalani/slides.git
synced 2026-01-08 22:07:59 -05:00
Bind N to navigate to previous slide (#238)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user