Ticket #3757: cannot show more than one column in user defined listing mode.

In user-defined listing mode, the format string lets us specify how many
columns to display. E.g., for 3 columns:

    "half 3 type name | size | perm"

However, parse_panel_size() reads this digit only when `panel->list_type ==
list_brief`. We remove this check.

Incidentally, the assignment there to `panel->brief_cols` isn't needed. In
list_brief mode, `panel->brief_cols` is already set.

We also fix a related problem in the mouse handler: it erroneously assumes
`panel->list_cols > 1` happens only in list_brief mode.

(These bugs were introduced in commit fb474bc1c157.)

Signed-off-by: Mooffie <mooffie@gmail.com>
This commit is contained in:
Mooffie 2017-01-15 23:51:45 +02:00
parent b229abc1eb
commit 05661eda1d

View File

@ -1645,13 +1645,11 @@ parse_panel_size (WPanel * panel, const char *format, gboolean isstatus)
if (g_ascii_isdigit (*format)) if (g_ascii_isdigit (*format))
{ {
if (!isstatus && panel->list_type == list_brief) if (!isstatus)
{ {
panel->brief_cols = g_ascii_digit_value (*format); panel->list_cols = g_ascii_digit_value (*format);
if (panel->brief_cols < 1) if (panel->list_cols < 1)
panel->brief_cols = 1; panel->list_cols = 1;
panel->list_cols = panel->brief_cols;
} }
format++; format++;
@ -3874,7 +3872,7 @@ panel_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
{ {
my_index = panel->top_file + y; my_index = panel->top_file + y;
if (panel->list_type == list_brief && panel->list_cols > 1) if (panel->list_cols > 1)
{ {
int width, lines; int width, lines;