MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / HandleKey

Method HandleKey

internal/tui/views/pulumi.go:42–64  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

40}
41
42func (v *PulumiView) HandleKey(key string) PulumiEvent {
43 switch key {
44 case "up":
45 if v.ActiveSection == PulumiSectionContent {
46 v.ActiveSection = PulumiSectionHeader
47 }
48 case "down":
49 if v.ActiveSection == PulumiSectionHeader {
50 v.ActiveSection = PulumiSectionContent
51 }
52 case "left":
53 if v.ActiveSection == PulumiSectionHeader {
54 return PulumiEventPrevView
55 }
56 case "right":
57 if v.ActiveSection == PulumiSectionHeader {
58 return PulumiEventNextView
59 }
60 case "esc":
61 return PulumiEventQuit
62 }
63 return PulumiEventNone
64}
65
66func (v *PulumiView) Render(active bool, version string) string {
67 headerFocused := active && v.ActiveSection == PulumiSectionHeader

Callers 1

handleKeyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected