1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

fset: do not refresh buffer when an option not displayed is changed

This commit is contained in:
Sébastien Helleu
2017-06-16 21:35:01 +02:00
parent aa68fa623a
commit a9d90b98a6
+32 -6
View File
@@ -754,8 +754,7 @@ fset_option_set_max_length_fields_all ()
* Allocates an fset option structure using a pointer to a
* WeeChat/plugin option.
*
* Returns pointer to new fset option, NULL if the option does not match
* filters or if error.
* Returns pointer to new fset option, NULL if error.
*/
struct t_fset_option *
@@ -784,6 +783,26 @@ fset_option_alloc (struct t_config_option *option)
fset_option_set_values (new_fset_option, option);
return new_fset_option;
}
/*
* Allocates an fset option structure using a pointer to a
* WeeChat/plugin option.
*
* Returns pointer to new fset option, NULL if the option does not match
* filters or if error.
*/
struct t_fset_option *
fset_option_add (struct t_config_option *option)
{
struct t_fset_option *new_fset_option;
new_fset_option = fset_option_alloc (option);
if (!new_fset_option)
return NULL;
/* check if option match filters (if not, ignore it) */
if (!fset_option_match_filters (new_fset_option))
{
@@ -972,7 +991,7 @@ fset_option_get_options ()
ptr_section, "options");
while (ptr_option)
{
new_fset_option = fset_option_alloc (ptr_option);
new_fset_option = fset_option_add (ptr_option);
if (new_fset_option)
weechat_arraylist_add (fset_options, new_fset_option);
ptr_option = weechat_hdata_move (fset_hdata_config_option,
@@ -1295,10 +1314,13 @@ fset_option_export (const char *filename, int with_help)
void
fset_option_config_changed (const char *option_name)
{
struct t_fset_option *ptr_fset_option;
struct t_fset_option *ptr_fset_option, *new_fset_option;
struct t_config_option *ptr_option;
int full_refresh, line, num_options;
if (!fset_buffer)
return;
full_refresh = 0;
ptr_fset_option = (option_name) ?
@@ -1320,8 +1342,12 @@ fset_option_config_changed (const char *option_name)
}
else if (ptr_option)
{
/* option added: get options and refresh the whole buffer */
full_refresh = 1;
new_fset_option = fset_option_alloc (ptr_option);
if (fset_option_match_filters (new_fset_option))
{
/* option added: get options and refresh the whole buffer */
full_refresh = 1;
}
}
if (full_refresh)