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 | 2116bc776b93e40feea08904e690e34ec76b2ae5 (patch) | |
| tree | 19134b2fd1cf99e1a9338401e823773b4bfe76ba /src/io.c | |
| parent | 149d594012b32158cd5e29f484cf0274dde6af44 (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)); |
