Skip to content

Commit

Permalink
Fixed issue cmus#554 (factivate)
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rb31 authored and mahkoh committed Oct 14, 2016
1 parent 251ed86 commit 7c675a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion command_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ static void cmd_win_activate(char *arg)
browser_enter();
break;
case FILTERS_VIEW:
filters_activate();
filters_activate(1);
break;
case HELP_VIEW:
help_select();
Expand Down
13 changes: 9 additions & 4 deletions filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void edit_sel_filter(void)
enter_command_mode();
}

void filters_activate(void)
void filters_activate(int win_activate)
{
struct filter_entry *f;
struct expr *e, *expr = NULL;
Expand All @@ -142,8 +142,13 @@ void filters_activate(void)
if (f->act_stat != f->sel_stat)
unchanged = 0;
}
if (unchanged)
edit_sel_filter();

if (unchanged) {
if (win_activate)
edit_sel_filter();
else
return;
}

/* mark visited and AND together all selected filters
* mark any other filters unvisited */
Expand Down Expand Up @@ -275,7 +280,7 @@ void filters_activate_names(const char *str)
for_each_name(str, select_filter);

/* activate selected */
filters_activate();
filters_activate(0);
}

void filters_toggle_filter(void)
Expand Down
2 changes: 1 addition & 1 deletion filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void filters_set_live(const char *val);

void filters_activate_names(const char *str);

void filters_activate(void);
void filters_activate(int win_activate);
void filters_toggle_filter(void);
void filters_delete_filter(void);

Expand Down

0 comments on commit 7c675a7

Please sign in to comment.