Merge pull request #53 from panter-dsd/feature/HomeEndKeys

Use Home and End keys to navigate Top/Bottom.
This commit is contained in:
Caleb Bassi 2018-08-20 11:06:51 -07:00 committed by GitHub
commit 603e851f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,15 +138,19 @@ func (self *Proc) keyBinds() {
self.KeyPressed <- true self.KeyPressed <- true
}) })
viKeys := []string{"j", "k", "gg", "G", "<C-d>", "<C-u>", "<C-f>", "<C-b>"} viKeys := []string{"j", "k", "gg", "G", "<C-d>", "<C-u>", "<C-f>", "<C-b>", "<home>", "<end>"}
ui.On(viKeys, func(e ui.Event) { ui.On(viKeys, func(e ui.Event) {
switch e.Key { switch e.Key {
case "j": case "j":
self.Down() self.Down()
case "k": case "k":
self.Up() self.Up()
case "<home>":
fallthrough
case "gg": case "gg":
self.Top() self.Top()
case "<end>":
fallthrough
case "G": case "G":
self.Bottom() self.Bottom()
case "<C-d>": case "<C-d>":