From 50e26a2bac3c3accddca6769be5d4663701ff115 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 9 Jul 2017 11:03:04 +0900 Subject: [PATCH] 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 --- src/string.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/string.hh b/src/string.hh index 2a384cde..70a95374 100644 --- a/src/string.hh +++ b/src/string.hh @@ -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)