mirror of
https://github.com/json-c/json-c.git
synced 2026-03-26 08:29:06 +08:00
Adding JSON_C_TO_STRING_PRETTY_TAB flag
- Tabs are easier to read for tired eyes and editor adjustable
This commit is contained in:
@@ -300,7 +300,14 @@ static void indent(struct printbuf *pb, int level, int flags)
|
||||
{
|
||||
if (flags & JSON_C_TO_STRING_PRETTY)
|
||||
{
|
||||
printbuf_memset(pb, -1, ' ', level * 2);
|
||||
if (flags & JSON_C_TO_STRING_PRETTY_TAB)
|
||||
{
|
||||
printbuf_memset(pb, -1, '\t', level);
|
||||
}
|
||||
else
|
||||
{
|
||||
printbuf_memset(pb, -1, ' ', level * 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user