diff options
Diffstat (limited to 'src/operetta.c')
| -rw-r--r-- | src/operetta.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/operetta.c b/src/operetta.c index 9b7fea3..ae9a418 100644 --- a/src/operetta.c +++ b/src/operetta.c @@ -32,7 +32,19 @@ int main(int argc, char** argv) { snprintf(s, 100, "%d. %s BECAUSE: %s <%s>", i + 1, propString, justString, isValid ? "SOUND" : "UNSOUND"); free(propString); free(justString); - consoleLines[i] = init_simple_consoleline(CWHITE, s); + int indent = lines.lines[i].scope.depth; + if (indent > 0) { + char* si = malloc(sizeof(char) * (indent + strlen(s) + 1)); + for (int j = 0; j < indent; j++) { + si[j] = ' '; + } + si[indent] = '\0'; + strcat(si, s); + consoleLines[i] = init_simple_consoleline(CWHITE, si); + } + else { + consoleLines[i] = init_simple_consoleline(CWHITE, s); + } } set_cache(init_consolelineset(consoleLines, lines.count)); /* enter main loop */ |
