1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

fset: add variable allowed_values in options, add two color options

New options:

- fset.color.allowed_values
- fset.color.allowed_values_selected
This commit is contained in:
Sébastien Helleu
2023-07-08 16:50:42 +02:00
parent 4c0c7d9adc
commit 1d5433485c
23 changed files with 360 additions and 88 deletions
+25 -2
View File
@@ -625,7 +625,9 @@ fset_buffer_display_option_eval (struct t_fset_option *fset_option)
}
/* min */
snprintf (str_field, length_field, "%s", fset_option->min);
snprintf (str_field, length_field,
"%s",
(fset_option->min) ? fset_option->min : "");
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"__min", str_field);
snprintf (str_field, length_field,
@@ -642,7 +644,9 @@ fset_buffer_display_option_eval (struct t_fset_option *fset_option)
"empty_min", str_field2);
/* max */
snprintf (str_field, length_field, "%s", fset_option->max);
snprintf (str_field, length_field,
"%s",
(fset_option->max) ? fset_option->max : "");
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"__max", str_field);
snprintf (str_field, length_field,
@@ -744,6 +748,25 @@ fset_buffer_display_option_eval (struct t_fset_option *fset_option)
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"empty_string_values", str_field2);
/* allowed_values */
snprintf (str_field, length_field,
"%s",
(fset_option->allowed_values) ? fset_option->allowed_values : "");
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"__allowed_values", str_field);
snprintf (str_field, length_field,
"%s%s",
weechat_color (weechat_config_string (fset_config_color_allowed_values[selected_line])),
(fset_option->allowed_values) ? fset_option->allowed_values : "");
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"_allowed_values", str_field);
fset_buffer_fills_field (str_field, str_field2, length_field,
fset_option_max_length->allowed_values, 1, 1);
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"allowed_values", str_field);
weechat_hashtable_set (fset_buffer_hashtable_extra_vars,
"empty_allowed_values", str_field2);
/* marked */
snprintf (str_field, length_field,
"%s",