Add nav-page-{up,down}.

This commit is contained in:
Qi Xiao 2016-04-05 06:36:30 +02:00
parent 425f19165f
commit 29dbe00e49
2 changed files with 20 additions and 8 deletions

View File

@ -55,6 +55,8 @@ var builtins = []Builtin{
{"start-nav", startNav},
{"nav-up", navUp},
{"nav-down", navDown},
{"nav-page-up", navPageUp},
{"nav-page-down", navPageDown},
{"nav-left", navLeft},
{"nav-right", navRight},
{"nav-trigger-shown-hidden", navTriggerShowHidden},
@ -149,14 +151,16 @@ var defaultBindings = map[ModeType]map[Key]string{
Default: "compl-default",
},
modeNavigation: map[Key]string{
Key{Up, 0}: "nav-up",
Key{Down, 0}: "nav-down",
Key{Left, 0}: "nav-left",
Key{Right, 0}: "nav-right",
Key{Tab, 0}: "nav-insert-selected",
Key{'H', Ctrl}: "nav-trigger-shown-hidden",
Key{'[', Ctrl}: "start-insert",
Default: "navigation-default",
Key{Up, 0}: "nav-up",
Key{Down, 0}: "nav-down",
Key{PageUp, 0}: "nav-page-up",
Key{PageDown, 0}: "nav-page-down",
Key{Left, 0}: "nav-left",
Key{Right, 0}: "nav-right",
Key{Tab, 0}: "nav-insert-selected",
Key{'H', Ctrl}: "nav-trigger-shown-hidden",
Key{'[', Ctrl}: "start-insert",
Default: "navigation-default",
},
modeHistory: map[Key]string{
Key{Up, 0}: "history-up",

View File

@ -44,6 +44,14 @@ func navDown(ed *Editor) {
ed.navigation.next()
}
func navPageUp(ed *Editor) {
ed.navigation.current.pageUp()
}
func navPageDown(ed *Editor) {
ed.navigation.current.pageDown()
}
func navLeft(ed *Editor) {
ed.navigation.ascend()
}