(clr aec.ANSI, s string)
| 492 | } |
| 493 | |
| 494 | func (h imgColumn) PrintC(clr aec.ANSI, s string) string { |
| 495 | ln := tui.Width(s) |
| 496 | |
| 497 | fill := h.Width - ln |
| 498 | |
| 499 | if fill < 0 { |
| 500 | if h.NoEllipsis { |
| 501 | fill = 0 |
| 502 | } else { |
| 503 | return clr.Apply(tui.Ellipsis(s, h.Width)) |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | l := fill / 2 |
| 508 | r := fill - l |
| 509 | |
| 510 | return strings.Repeat(" ", l) + clr.Apply(s) + strings.Repeat(" ", r) |
| 511 | } |
| 512 | |
| 513 | func (h imgColumn) PrintL(clr aec.ANSI, s string) string { |
| 514 | ln := tui.Width(s) |