changed the indentation algorithm when pretty printing the space format (no visual changes)

pull/4/head
Tomasz Sowa 2 years ago
parent 679b9e6173
commit 539faa4976

@ -340,7 +340,7 @@ public:
{
if( is_object() )
{
serialize_to_space_stream(str, pretty_print, -1, true);
serialize_to_space_stream(str, pretty_print, 0, true);
}
}
@ -671,7 +671,7 @@ protected:
if( !is_main_object )
{
print_level(pretty_print, level - 2, str);
print_level(pretty_print, level - 1, str);
str << '}';
print_if(pretty_print, str, '\n');
}
@ -733,7 +733,7 @@ protected:
}
print_if(pretty_print && multivalue_table, str, '\n');
print_level(pretty_print && multivalue_table, level - 2, str);
print_level(pretty_print && multivalue_table, level - 1, str);
str << ')';
}
@ -930,11 +930,11 @@ protected:
break;
case type_object:
serialize_space_object(str, pretty_print, level + 1, is_main_object);
serialize_space_object(str, pretty_print, level, is_main_object);
break;
case type_table:
serialize_space_table(str, pretty_print, level + 1);
serialize_space_table(str, pretty_print, level);
break;
}
}
@ -967,7 +967,7 @@ protected:
{
for(int i=0 ; i < level ; ++i)
{
str << ' ';
str << ' ' << ' ';
}
}
}

Loading…
Cancel
Save