diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-05-31 21:31:01 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-25 16:35:27 +0200 |
commit | bf7135dd9def36425d17e5d15236061f594bdc75 (patch) | |
tree | cc9fce646ee818fb82f918deb016ebf7274893ee /src/plugins/fset/fset-buffer.c | |
parent | cc0ba21e67bb56ba270efc59e2aa108bb44f2f15 (diff) | |
download | weechat-bf7135dd9def36425d17e5d15236061f594bdc75.zip |
fset: add ${default_value_undef} and ${value_changed}
Diffstat (limited to 'src/plugins/fset/fset-buffer.c')
-rw-r--r-- | src/plugins/fset/fset-buffer.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/fset/fset-buffer.c b/src/plugins/fset/fset-buffer.c index 9b2e222e2..12db4265f 100644 --- a/src/plugins/fset/fset-buffer.c +++ b/src/plugins/fset/fset-buffer.c @@ -103,7 +103,7 @@ fset_buffer_display_line (int y, struct t_fset_option *fset_option) char *line, str_field[4096]; const char *ptr_field, *ptr_parent_value; int selected_line; - int default_value_undef, value_undef, value_diff; + int default_value_undef, value_undef, value_changed; int add_quotes, add_quotes_parent; struct t_config_option *ptr_option_color_value; @@ -111,7 +111,7 @@ fset_buffer_display_line (int y, struct t_fset_option *fset_option) default_value_undef = (fset_option->default_value == NULL) ? 1 : 0; value_undef = (fset_option->value == NULL) ? 1 : 0; - value_diff = (fset_option_value_different_from_default (fset_option)) ? 1 : 0; + value_changed = (fset_option_value_is_changed (fset_option)) ? 1 : 0; /* set pointers */ weechat_hashtable_set (fset_buffer_hashtable_pointers, @@ -197,8 +197,8 @@ fset_buffer_display_line (int y, struct t_fset_option *fset_option) add_quotes = (ptr_field && (strcmp (fset_option->type, "string") == 0)) ? 1 : 0; if (value_undef) ptr_option_color_value = fset_config_color_value_undef[selected_line]; - else if (value_diff) - ptr_option_color_value = fset_config_color_value_diff[selected_line]; + else if (value_changed) + ptr_option_color_value = fset_config_color_value_changed[selected_line]; else ptr_option_color_value = fset_config_color_value[selected_line]; snprintf (str_field, sizeof (str_field), @@ -375,8 +375,14 @@ fset_buffer_display_line (int y, struct t_fset_option *fset_option) /* set other variables depending on the value */ weechat_hashtable_set (fset_buffer_hashtable_extra_vars, + "default_value_undef", + (default_value_undef) ? "1" : "0"); + weechat_hashtable_set (fset_buffer_hashtable_extra_vars, "value_undef", - (fset_option->value == NULL) ? "1" : "0"); + (value_undef) ? "1" : "0"); + weechat_hashtable_set (fset_buffer_hashtable_extra_vars, + "value_changed", + (value_changed) ? "1" : "0"); /* build string for line */ line = weechat_string_eval_expression ( |