diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-17 21:45:28 +0000 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-17 21:45:28 +0000 |
commit | a36a6bcd305806536230995599d69e1f30ccbab0 (patch) | |
tree | 8ce4916e876e49937afbb2ea7c39d14f6f61e7ca /print.c | |
parent | 0f9d219bf2f9c24f24014499c3ef6ee50909e054 (diff) |
Implement text data
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -81,6 +81,8 @@ pparray(Array *a) free(arrstr); }else if(a->type == AtypeInt) elemstrs[i] = runesmprint("%lld", a->intdata[i]); + else if(a->type == AtypeRune) + elemstrs[i] = runesmprint("%C", a->runedata[i]); else if(a->type == AtypeFloat){ char *fmt = smprint("%%.%df", printprecision); elemstrs[i] = runesmprint(fmt, a->floatdata[i]); @@ -124,7 +126,13 @@ pparray(Array *a) char *fmt = smprint("%%%s%dS", align, widths[x]); Rune *line = strline(elemstrs[i], y); Rune *padded = runesmprint(fmt, line); - Rune *spacing = boxing ? L"│" : (x == lastdim-1) ? L"" : L" "; + Rune *spacing; + if(boxing) + spacing = L"│"; + else if(x == lastdim - 1 || a->type == AtypeRune) + spacing = L""; + else + spacing = L" "; rowstrs[row] = runesmprint("%S%S%S", tmp, padded, spacing); free(tmp); free(fmt); |