diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/fset/fset-option.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c index 6e31e93a3..ea2695cf4 100644 --- a/src/plugins/fset/fset-option.c +++ b/src/plugins/fset/fset-option.c @@ -1200,7 +1200,7 @@ fset_option_toggle_mark (struct t_fset_option *fset_option, void fset_option_mark_options_matching_filter (const char *filter, int mark) { - int num_options, i, mark_old; + int num_options, i, mark_old, matching; struct t_fset_option *ptr_fset_option; num_options = weechat_arraylist_size (fset_options); @@ -1210,12 +1210,20 @@ fset_option_mark_options_matching_filter (const char *filter, int mark) if (ptr_fset_option) { mark_old = ptr_fset_option->marked; - if (fset_option_match_filter (ptr_fset_option, filter)) - ptr_fset_option->marked = mark; - else - ptr_fset_option->marked = mark ^ 1; - if (mark_old != ptr_fset_option->marked) - fset_option_count_marked += (ptr_fset_option->marked) ? 1 : -1; + matching = fset_option_match_filter (ptr_fset_option, filter); + if (matching) + { + if (!mark_old && mark) + { + ptr_fset_option->marked = 1; + fset_option_count_marked++; + } + else if (mark_old && !mark) + { + ptr_fset_option->marked = 0; + fset_option_count_marked--; + } + } } } fset_buffer_refresh (0); |