fset: fix slow refresh of fset buffer during /reload (closes #1313)

v2.8-utf8proc
Sébastien Helleu 2019-02-22 21:33:39 +01:00
parent 355843b27a
commit baa598276c
3 changed files with 29 additions and 5 deletions

View File

@ -24,6 +24,7 @@ New features::
Bug fixes::
* fset: fix slow refresh of fset buffer during /reload (issue #1313)
* spell: fix detection of nick followed by the nick completer (issue #1306, issue #1307)
Build::

View File

@ -1491,9 +1491,20 @@ fset_option_config_timer_cb (const void *pointer,
(void) data;
(void) remaining_calls;
weechat_hashtable_map (fset_option_timer_options_changed,
&fset_option_timer_option_changed_cb,
NULL);
if (weechat_hashtable_get_integer (
fset_option_timer_options_changed,
"items_count") >= FSET_OPTION_TIMER_MAX_OPTIONS_CHANGED)
{
fset_option_get_options ();
fset_buffer_refresh (1);
}
else
{
weechat_hashtable_map (fset_option_timer_options_changed,
&fset_option_timer_option_changed_cb,
NULL);
}
weechat_hashtable_remove_all (fset_option_timer_options_changed);
fset_option_timer_hook = NULL;
@ -1527,8 +1538,18 @@ fset_option_config_cb (const void *pointer,
if (ptr_info && (strcmp (ptr_info, "1") == 0))
return WEECHAT_RC_OK;
weechat_hashtable_set (fset_option_timer_options_changed,
option, NULL);
/*
* we limit the number of options to display with the timer; for example
* on /reload, many options are changed, so we'll get all options and
* display them, instead of change them one by one, which is very slow
*/
if (weechat_hashtable_get_integer (
fset_option_timer_options_changed,
"items_count") < FSET_OPTION_TIMER_MAX_OPTIONS_CHANGED)
{
weechat_hashtable_set (fset_option_timer_options_changed,
option, NULL);
}
if (!fset_option_timer_hook)
{

View File

@ -22,6 +22,8 @@
#define FSET_OPTION_VALUE_NULL "null"
#define FSET_OPTION_TIMER_MAX_OPTIONS_CHANGED 32
enum t_fset_option_type
{
FSET_OPTION_TYPE_BOOLEAN = 0,