MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / view

Method view

internal/cli/tool_menu.go:94–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func (s pickerStep) view() string {
95 var b strings.Builder
96 b.WriteString(s.title)
97 b.WriteString("\n\n")
98 if s.filter != "" {
99 fmt.Fprintf(&b, "Filter: %s\n\n", s.filter)
100 }
101 v, offset := s.visibleWindow()
102 if len(v) == 0 {
103 b.WriteString("No items match your filter.\n")
104 } else {
105 for i, item := range v {
106 cursor := " "
107 if i+offset == s.cursor {
108 cursor = ">"
109 }
110 fmt.Fprintf(&b, "%s %s\n", cursor, item)
111 }
112 }
113 if s.hint != "" {
114 b.WriteString("\n")
115 b.WriteString(s.hint)
116 b.WriteString("\n")
117 }
118 return b.String()
119}
120
121func (s pickerStep) visible() []string {
122 v, _ := s.visibleWindow()

Calls 1

visibleWindowMethod · 0.95