summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/fset/fset-option.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c
index 8ee364374..ab13b9367 100644
--- a/src/plugins/fset/fset-option.c
+++ b/src/plugins/fset/fset-option.c
@@ -1423,7 +1423,14 @@ fset_option_config_changed (const char *option_name)
if (full_refresh)
{
fset_option_get_options ();
- fset_buffer_selected_line = 0;
+ num_options = weechat_arraylist_size (fset_options);
+ if (num_options > 0)
+ {
+ if (fset_buffer_selected_line >= num_options)
+ fset_buffer_selected_line = num_options - 1;
+ }
+ else
+ fset_buffer_selected_line = 0;
fset_buffer_refresh (1);
}
else