func actions()

in pkg/display/graph/tree/tree.go [130:154]


func actions(key string, tree *widgets.Tree) func() {
	// mostly vim style
	actions := map[string]func(){
		"k":      tree.ScrollUp,
		"<Up>":   tree.ScrollUp,
		"j":      tree.ScrollDown,
		"<Down>": tree.ScrollDown,
		"<C-b>":  tree.ScrollPageUp,
		"<C-u>":  tree.ScrollHalfPageUp,
		"<C-f>":  tree.ScrollPageDown,
		"<C-d>":  tree.ScrollHalfPageDown,
		"<Home>": tree.ScrollTop,
		"o":      tree.ToggleExpand,
		"G":      tree.ScrollBottom,
		"<End>":  tree.ScrollBottom,
		"E":      tree.ExpandAll,
		"C":      tree.CollapseAll,
		"<Resize>": func() {
			x, y := ui.TerminalDimensions()
			tree.SetRect(0, 0, x, y)
		},
	}

	return actions[key]
}