if (cl->width < len)
cl->width = len;
+
+fprintf(stderr, "KZAK: 1: %s = %d\n", cl->name, cl->width);
+
}
}
struct tt_column *cl =
list_entry(p, struct tt_column, cl_columns);
- size_t len = mbs_width(cl->name);
+ cl->width_min = mbs_width(cl->name);
- if (cl->width < len)
- cl->width = len;
- else if (cl->width_hint >= 1)
+ if (cl->width < cl->width_min)
+ cl->width = cl->width_min;
+ else if (cl->width_hint >= 1 &&
+ cl->width_min < (int) cl->width_hint)
cl->width = (int) cl->width_hint;
width += cl->width + (is_last_column(tb, cl) ? 0 : 1);
+
+fprintf(stderr, "KZAK: 2: %s = %d\n", cl->name, cl->width);
+
}
if (width == tb->termwidth)
continue; /* never truncate the tree */
if (trunc_only && !(cl->flags & TT_FL_TRUNCATE))
continue;
+ if (cl->width == cl->width_min)
+ continue;
if (cl->width > cl->width_hint * tb->termwidth) {
cl->width--;
width--;
}
}
leave:
-/*
+///*
fprintf(stderr, "terminal: %d, output: %d\n", tb->termwidth, width);
list_for_each(p, &tb->tb_columns) {
cl->width_hint > 1 ? (int) cl->width_hint :
(int) (cl->width_hint * tb->termwidth));
}
-*/
+//*/
return;
}