From 730313437437a9495390b7c2f0a6eded3dbc2653 Mon Sep 17 00:00:00 2001 From: ame Date: Tue, 26 Dec 2023 12:53:21 -0600 Subject: better pretty print --- src/config.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 25919d1..0c8a813 100644 --- a/src/config.c +++ b/src/config.c @@ -6,6 +6,7 @@ int _print_type = 0; int _max_depth = 2; int _start_nl_at = 3; int _collapse_all = 0; +int _collapse_to_memory = 1; int _file_malloc_chunk = 512; @@ -24,7 +25,13 @@ int l_set(lua_State* L) { int ind = get_config_map(lua_tostring(L,-2)); if(ind != -1) { - *config_map[ind].value = lua_tonumber(L,-1); + int key; + if(lua_isboolean(L, -1)){ + key = lua_toboolean(L, -1); + } else { + key = lua_tonumber(L, -1); + } + *config_map[ind].value = key; lua_pushnumber(L, 1); return 1; } -- cgit v1.2.3