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
})
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) {
switch e.Key {
case "j":
self.Down()
case "k":
self.Up()
case "<home>":
fallthrough
case "gg":
self.Top()
case "<end>":
fallthrough
case "G":
self.Bottom()
case "<C-d>":