MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / SetApp

Method SetApp

internal/ui/components/node_list.go:49–65  ·  view source on GitHub ↗

SetApp sets the parent app reference for focus management.

(app *App)

Source from the content-addressed store, hash-verified

47
48// SetApp sets the parent app reference for focus management.
49func (nl *NodeList) SetApp(app *App) {
50 nl.app = app
51
52 // Set up input capture for arrow keys and VI-like navigation (hjkl)
53 navigationCapture := createNavigationInputCapture(nl.app, nil, nl.app.nodeDetails)
54 var pendingG bool
55 nl.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
56 if handleVimTopBottomRune(event, &pendingG, func() {
57 jumpListTop(nl.List)
58 }, func() {
59 jumpListBottom(nl.List)
60 }) {
61 return nil
62 }
63 return navigationCapture(event)
64 })
65}
66
67// SetNodes updates the list with the provided nodes.
68func (nl *NodeList) SetNodes(nodes []*api.Node) {

Callers

nothing calls this directly

Calls 4

handleVimTopBottomRuneFunction · 0.85
jumpListTopFunction · 0.85
jumpListBottomFunction · 0.85

Tested by

no test coverage detected