libsmartcols: reduce relative columns more aggressively
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
053939a45a
commit
5627fcec0e
|
@ -877,12 +877,15 @@ static int recount_widths(struct libscols_table *tb, struct libscols_buffer *buf
|
|||
if (cl->width == cl->width_min)
|
||||
continue;
|
||||
|
||||
DBG(TAB, ul_debugobj(tb, " tring to reduce: %s (width=%zu)", cl->header.data, cl->width));
|
||||
|
||||
/* truncate column with relative sizes */
|
||||
if (cl->width_hint < 1 && cl->width > 0 && width > 0 &&
|
||||
cl->width > cl->width_hint * tb->termwidth) {
|
||||
cl->width >= (size_t) (cl->width_hint * tb->termwidth)) {
|
||||
cl->width--;
|
||||
width--;
|
||||
}
|
||||
|
||||
/* truncate column with absolute size */
|
||||
if (cl->width_hint > 1 && cl->width > 0 && width > 0 &&
|
||||
!trunc_only) {
|
||||
|
|
Loading…
Reference in New Issue