MCPcopy
hub / github.com/cli/cli / newExtList

Function newExtList

pkg/cmd/extension/browse/browse.go:110–131  ·  view source on GitHub ↗
(opts ExtBrowseOpts, ui uiRegistry, extEntries []extEntry)

Source from the content-addressed store, hash-verified

108func (w *fakeGroup) Wait() {}
109
110func newExtList(opts ExtBrowseOpts, ui uiRegistry, extEntries []extEntry) *extList {
111 ui.List.SetTitleColor(tcell.ColorWhite)
112 ui.List.SetSelectedTextColor(tcell.ColorBlack)
113 ui.List.SetSelectedBackgroundColor(tcell.ColorWhite)
114 ui.List.SetWrapAround(false)
115 ui.List.SetBorderPadding(1, 1, 1, 1)
116 ui.List.SetSelectedFunc(func(ix int, _, _ string, _ rune) {
117 ui.Pages.SwitchToPage("readme")
118 })
119
120 el := &extList{
121 ui: ui,
122 extEntries: extEntries,
123 app: ui.App,
124 opts: opts,
125 QueueUpdateDraw: ui.App.QueueUpdateDraw,
126 WaitGroup: &fakeGroup{},
127 }
128
129 el.Reset()
130 return el
131}
132
133func (el *extList) createModal() *tview.Modal {
134 m := tview.NewModal()

Callers 3

ExtBrowseFunction · 0.85
Test_getSelectedReadmeFunction · 0.85
Test_extListFunction · 0.85

Calls 1

ResetMethod · 0.95

Tested by 2

Test_getSelectedReadmeFunction · 0.68
Test_extListFunction · 0.68