Remove assert in String::String(Codepoint, ColumnCount)

codepoint_width is locale dependent, and we could end up with it
returning a different value depending on the locale. It is better
to return a string of the wrong column length than fail on assert
in this case as we cannot fix it anyway.

Fixes #1489
This commit is contained in:
Maxime Coste 2017-07-09 11:03:04 +09:00
parent 52c8dc9d09
commit 50e26a2bac

View File

@ -113,7 +113,6 @@ public:
}
explicit String(Codepoint cp, ColumnCount count)
{
kak_assert(count % codepoint_width(cp) == 0);
int cp_count = (int)(count / std::max(codepoint_width(cp), 1_col));
reserve(utf8::codepoint_size(cp) * cp_count);
while (cp_count-- > 0)