Skip to content

Commit

Permalink
Add alternatives for scroll actions to context map
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas authored and jesseduffield committed May 12, 2019
1 parent 97f060d commit e38d9d5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/keybindings/Keybindings_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
## Main (Normal)

<pre>
<kbd>PgDn</kbd>: scroll down
<kbd>PgUp</kbd>: scroll up
<kbd>PgDn</kbd>: scroll down (fn+up)
<kbd>PgUp</kbd>: scroll up (fn+down)
</pre>

## Main (Staging)
Expand Down
4 changes: 2 additions & 2 deletions docs/keybindings/Keybindings_nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
## Hoofd (Normaal)

<pre>
<kbd>PgDn</kbd>: scroll omlaag
<kbd>PgUp</kbd>: scroll omhoog
<kbd>PgDn</kbd>: scroll omlaag (fn+up)
<kbd>PgUp</kbd>: scroll omhoog (fn+down)
</pre>

## Hoofd (Stage Lines/Hunks)
Expand Down
4 changes: 2 additions & 2 deletions docs/keybindings/Keybindings_pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
## Main (Normal)

<pre>
<kbd>PgDn</kbd>: scroll down
<kbd>PgUp</kbd>: scroll up
<kbd>PgDn</kbd>: scroll down (fn+up)
<kbd>PgUp</kbd>: scroll up (fn+down)
</pre>

## Main (Zatwierdzanie)
Expand Down
2 changes: 2 additions & 0 deletions pkg/gui/keybindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,14 @@ func (gui *Gui) GetContextMap() map[string]map[string][]*Binding {
Modifier: gocui.ModNone,
Handler: gui.scrollDownMain,
Description: gui.Tr.SLocalize("ScrollDown"),
Alternative: "fn+up",
}, {
ViewName: "main",
Key: gocui.MouseWheelUp,
Modifier: gocui.ModNone,
Handler: gui.scrollUpMain,
Description: gui.Tr.SLocalize("ScrollUp"),
Alternative: "fn+down",
},
},
"staging": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_cheatsheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func getBindingSections(mApp *app.App) []*bindingSection {
}

func addBinding(title string, bindingSections []*bindingSection, binding *gui.Binding) []*bindingSection {
if binding.Description == "" {
if binding.Description == "" && binding.Alternative == "" {
return bindingSections
}

Expand Down

0 comments on commit e38d9d5

Please sign in to comment.