1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +00:00

Don't rely on obscure printf features.

They may not work on all platforms.
This commit is contained in:
Calvin Rose 2020-01-18 00:27:00 -06:00
parent a8e4c4bed0
commit 521a29446f

View File

@ -487,11 +487,16 @@ static void kshowcomp(void) {
if (cols == 0) cols = 1;
int current_col = 0;
for (int i = 0; i < gbl_match_count; i++) {
if (current_col == 0) printf("\n");
printf("%-*s", col_width, (const char *) gbl_matches[i].bytes);
if (current_col == 0) putc('\n', stdout);
JanetByteView s = gbl_matches[i];
printf("%s", (const char *) s.bytes);
for (int j = s.len; j < col_width; j++) {
putc(' ', stdout);
}
current_col = (current_col + 1) % cols;
}
printf("\n");
putc('\n', stdout);
fflush(stdout);
rawmode();
}