diff options
Diffstat (limited to 'src/plugins/fset')
-rw-r--r-- | src/plugins/fset/fset-buffer.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/src/plugins/fset/fset-buffer.c b/src/plugins/fset/fset-buffer.c index edeb7912d..ff8a32688 100644 --- a/src/plugins/fset/fset-buffer.c +++ b/src/plugins/fset/fset-buffer.c @@ -1546,24 +1546,39 @@ fset_buffer_set_localvar_filter () void fset_buffer_open () { - if (!fset_buffer) + struct t_hashtable *buffer_props; + + if (fset_buffer) + return; + + buffer_props = weechat_hashtable_new ( + 32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, + NULL); + if (buffer_props) { - fset_buffer = weechat_buffer_new ( - FSET_BUFFER_NAME, - &fset_buffer_input_cb, NULL, NULL, - &fset_buffer_close_cb, NULL, NULL); + weechat_hashtable_set (buffer_props, "type", "free"); + weechat_hashtable_set (buffer_props, "localvar_set_type", "option"); + } - /* failed to create buffer ? then exit */ - if (!fset_buffer) - return; + fset_buffer = weechat_buffer_new_props ( + FSET_BUFFER_NAME, + buffer_props, + &fset_buffer_input_cb, NULL, NULL, + &fset_buffer_close_cb, NULL, NULL); - weechat_buffer_set (fset_buffer, "type", "free"); - fset_buffer_set_keys (); - weechat_buffer_set (fset_buffer, "localvar_set_type", "option"); - fset_buffer_set_localvar_filter (); + if (buffer_props) + weechat_hashtable_free (buffer_props); - fset_buffer_selected_line = 0; - } + if (!fset_buffer) + return; + + fset_buffer_set_keys (); + fset_buffer_set_localvar_filter (); + + fset_buffer_selected_line = 0; } /* |