MCPcopy Create free account
hub / github.com/driangle/taskmd / writeRow

Method writeRow

apps/cli/internal/cli/tablewriter.go:93–110  ·  view source on GitHub ↗
(w io.Writer, row tableRow, widths []int)

Source from the content-addressed store, hash-verified

91}
92
93func (tw *TableWriter) writeRow(w io.Writer, row tableRow, widths []int) {
94 cells := make([]string, len(widths))
95 for i := range widths {
96 var plain, colored string
97 if i < len(row.plain) {
98 plain = row.plain[i]
99 }
100 if i < len(row.colored) {
101 colored = row.colored[i]
102 }
103 padding := widths[i] - len(plain)
104 if padding < 0 {
105 padding = 0
106 }
107 cells[i] = colored + strings.Repeat(" ", padding)
108 }
109 fmt.Fprintln(w, strings.Join(cells, tw.gap))
110}
111
112// StripANSI removes ANSI escape sequences from a string.
113func StripANSI(s string) string {

Callers 1

FlushMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected