FormatMsg method on WC value receiver
Vladimir Bauer
3 years ago
| 136 | 136 | |
| 137 | 137 | // FormatMsg formats final message according to WC.W and WC.C. |
| 138 | 138 | // Should be called by any Decorator implementation. |
| 139 | func (wc *WC) FormatMsg(msg string) string { | |
| 139 | func (wc WC) FormatMsg(msg string) string { | |
| 140 | 140 | pureWidth := runewidth.StringWidth(msg) |
| 141 | 141 | viewWidth := runewidth.StringWidth(stripansi.Strip(msg)) |
| 142 | 142 | max := wc.W |