| 1317 | } |
| 1318 | |
| 1319 | int wstring_width(const std::wstring& text) { |
| 1320 | int width = 0; |
| 1321 | |
| 1322 | for (const wchar_t& it : text) { |
| 1323 | const int w = wchar_width(it); |
| 1324 | if (w < 0) { |
| 1325 | return -1; |
| 1326 | } |
| 1327 | width += w; |
| 1328 | } |
| 1329 | return width; |
| 1330 | } |
| 1331 | |
| 1332 | // Return how many cells the UTF8 encoded string |input| is taking when printed. |
| 1333 | // Control characters are not taking any space, combining characters are |
nothing calls this directly
no test coverage detected