aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorame <[email protected]>2023-12-26 12:53:21 -0600
committerame <[email protected]>2023-12-26 12:53:21 -0600
commit730313437437a9495390b7c2f0a6eded3dbc2653 (patch)
treeb8cf0d057f32624e5f5336787d4db369a33c211a /src/config.c
parent8c0dc0f4baa231a359f9785da14b1df8e7a6c0ac (diff)
better pretty print
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c9
1 files changed, 8 insertions, 1 deletions
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;
}