diff options
| author | ame <[email protected]> | 2024-02-22 10:39:36 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-02-22 10:39:36 -0600 |
| commit | 946a56f9cc8de329af27ec3550b545493080f597 (patch) | |
| tree | 19134b2fd1cf99e1a9338401e823773b4bfe76ba /src/io.c | |
| parent | 867a86a9ab31c0652a46759443fc98a49f91c8dd (diff) | |
better print
Diffstat (limited to 'src/io.c')
| -rw-r--r-- | src/io.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -124,9 +124,16 @@ void i_pprint(lua_State* L, int indent, int skip_indent){ size_t len; char* wowa = (char*)luaL_tolstring(L, -1, &len); printf("\""); - for(int i = 0; i != len; i++) printf("%c",wowa[i]); + for(int i = 0; i != len; i++) { + printf("%c",wowa[i]); + if(wowa[i] == '\n') print_indentation(indent); + } printf("\""); break; + case LUA_TBOOLEAN: + if(!skip_indent) print_indentation(indent); + printf(color_blue"%s"color_reset, lua_toboolean(L,-1)?"true":"false"); + break; case LUA_TFUNCTION: if(!skip_indent) print_indentation(indent); printf(color_yellow"(%p)"color_reset, lua_topointer(L, -1)); |
