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

Function wrapFooter

pkg/cmd/extension/browse/model.go:502–516  ·  view source on GitHub ↗
(footer string, width int)

Source from the content-addressed store, hash-verified

500}
501
502func wrapFooter(footer string, width int) string {
503 var wrapped []string
504 for line := range strings.SplitSeq(footer, "\n") {
505 content := strings.TrimLeft(line, " \t")
506 indent := strings.ReplaceAll(line[:len(line)-len(content)], "\t", " ")
507 if content == "" {
508 wrapped = append(wrapped, "")
509 continue
510 }
511 for wrappedLine := range strings.SplitSeq(ansi.Hardwrap(content, max(width-len(indent), 1), false), "\n") {
512 wrapped = append(wrapped, indent+wrappedLine)
513 }
514 }
515 return strings.Join(wrapped, "\n")
516}
517
518func (m *browseModel) listView() string {
519 if len(m.filtered) == 0 {

Callers 1

footerViewMethod · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected