summaryrefslogtreecommitdiff
path: root/print.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-17 21:45:28 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-17 21:45:28 +0000
commita36a6bcd305806536230995599d69e1f30ccbab0 (patch)
tree8ce4916e876e49937afbb2ea7c39d14f6f61e7ca /print.c
parent0f9d219bf2f9c24f24014499c3ef6ee50909e054 (diff)
Implement text data
Diffstat (limited to 'print.c')
-rw-r--r--print.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/print.c b/print.c
index 15e5f2a..da60c7b 100644
--- a/print.c
+++ b/print.c
@@ -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);