Adding JSON_C_TO_STRING_PRETTY_TAB flag

- Tabs are easier to read for tired eyes and editor adjustable
This commit is contained in:
Jacob Alexander committed 2015-05-27 17:37:39 -07:00
1 parent 68d856f618
commit 92d4cf15f0
2 files changed
+16 -1

No files matched your search

+8 -1
View File
@@ -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);
}
}
}