mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Make sure there's always at least one column even if there's items
wider than max. width allows. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1320 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
bc0069c02f
commit
1b8705bd44
@ -638,6 +638,7 @@ int get_max_column_count(GSList *items, COLUMN_LEN_FUNC len_func,
|
||||
}
|
||||
|
||||
len = max_width/(item_extra+item_min_size);
|
||||
if (len <= 0) len = 1;
|
||||
if (max_columns <= 0 || len < max_columns)
|
||||
max_columns = len;
|
||||
|
||||
@ -670,7 +671,7 @@ int get_max_column_count(GSList *items, COLUMN_LEN_FUNC len_func,
|
||||
item_pos++;
|
||||
}
|
||||
|
||||
for (n = max_columns-1; n > 0; n--) {
|
||||
for (n = max_columns-1; n > 1; n--) {
|
||||
if (columns_width[n] <= max_width &&
|
||||
columns[n][n] > 0)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user