MCPcopy Create free account
hub / github.com/ArthurSonzogni/FTXUI / wstring_width

Function wstring_width

src/ftxui/screen/string.cpp:1319–1330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1317}
1318
1319int 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

Callers

nothing calls this directly

Calls 1

wchar_widthFunction · 0.85

Tested by

no test coverage detected