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:
parent
52c8dc9d09
commit
50e26a2bac
|
@ -113,7 +113,6 @@ public:
|
||||||
}
|
}
|
||||||
explicit String(Codepoint cp, ColumnCount count)
|
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));
|
int cp_count = (int)(count / std::max(codepoint_width(cp), 1_col));
|
||||||
reserve(utf8::codepoint_size(cp) * cp_count);
|
reserve(utf8::codepoint_size(cp) * cp_count);
|
||||||
while (cp_count-- > 0)
|
while (cp_count-- > 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user