diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-17 14:55:16 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-25 16:35:28 +0200 |
commit | 5acf4ba5745759497b63c35ff927438e8faa7ca4 (patch) | |
tree | 1fce290e6f411c8abdc970d21bfb633abb31c4ce /src | |
parent | 70f71be108409b4560b186a0e64c3a5c81e7b2cf (diff) | |
download | weechat-5acf4ba5745759497b63c35ff927438e8faa7ca4.zip |
fset: only mark/unmark matching options with "m:" and "u:", do not toggle mark on non-matching 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); |