MCPcopy Create free account
hub / github.com/cli/cli / View

Method View

pkg/cmd/extension/browse/model.go:364–399  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

362}
363
364func (m *browseModel) View() tea.View {
365 if m.height > 0 && m.height < 6 {
366 content := "terminal too small"
367 if m.width > 0 {
368 content = ansi.Truncate(content, m.width, "")
369 }
370 view := tea.NewView(content)
371 view.AltScreen = true
372 return view
373 }
374
375 if m.page == helpPage {
376 view := tea.NewView(m.helpView())
377 view.AltScreen = true
378 return view
379 }
380
381 if m.page == readmePage {
382 view := tea.NewView(m.readmePaneView())
383 view.AltScreen = true
384 return view
385 }
386
387 var content strings.Builder
388 content.WriteString(m.headerView())
389 content.WriteByte('\n')
390 content.WriteString(m.filterView())
391 content.WriteByte('\n')
392 content.WriteString(m.mainContent())
393 content.WriteByte('\n')
394 content.WriteString(m.footerView())
395
396 view := tea.NewView(content.String())
397 view.AltScreen = true
398 return view
399}
400
401func (m *browseModel) selectedEntry() (extEntry, bool) {
402 if m.cursor < 0 || m.cursor >= len(m.filtered) {

Callers

nothing calls this directly

Calls 7

helpViewMethod · 0.95
readmePaneViewMethod · 0.95
headerViewMethod · 0.95
filterViewMethod · 0.95
mainContentMethod · 0.95
footerViewMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected