sync with extra space if any
Vladimir Bauer
6 years ago
| 131 | 131 | runeCount := utf8.RuneCountInString(stripansi.Strip(msg)) |
| 132 | 132 | ansiCount := utf8.RuneCountInString(msg) - runeCount |
| 133 | 133 | if (wc.C & DSyncWidth) != 0 { |
| 134 | if (wc.C & DextraSpace) != 0 { | |
| 135 | runeCount++ | |
| 136 | } | |
| 134 | 137 | wc.wsync <- runeCount |
| 135 | 138 | max := <-wc.wsync |
| 136 | if (wc.C & DextraSpace) != 0 { | |
| 137 | max++ | |
| 138 | } | |
| 139 | 139 | format = fmt.Sprintf(wc.dynFormat, ansiCount+max) |
| 140 | 140 | } else { |
| 141 | 141 | format = fmt.Sprintf(wc.dynFormat, ansiCount+wc.W) |