feat: check if width == max before using ml-string

This commit is contained in:
ToruNiina
2021-06-27 18:56:57 +09:00
parent 47a2a3332b
commit be5ffaf662

View File

@@ -178,8 +178,9 @@ struct serializer
{
if(s.kind == string_t::basic)
{
if(std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend() ||
std::find(s.str.cbegin(), s.str.cend(), '\"') != s.str.cend())
if((std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend() ||
std::find(s.str.cbegin(), s.str.cend(), '\"') != s.str.cend()) &&
this->width_ != std::numeric_limits<std::size_t>::max())
{
// if linefeed or double-quote is contained,
// make it multiline basic string.