summaryrefslogtreecommitdiff
path: root/src/plugins/ruby/weechat-ruby.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-01-15 22:00:15 +0100
committerSébastien Helleu <flashcode@flashtux.org>2018-01-15 22:00:15 +0100
commit8fbbe8b0d509df26ff86ca8cd7fe4b2205c6d15e (patch)
tree3dd9f08f31f4c1fb513119a57f4ff33a45b51556 /src/plugins/ruby/weechat-ruby.c
parent21e63e7958c499b79a63612d7344ad4d53bd4284 (diff)
downloadweechat-8fbbe8b0d509df26ff86ca8cd7fe4b2205c6d15e.zip
scripts: add option "eval_keep_context" in script plugins
Diffstat (limited to 'src/plugins/ruby/weechat-ruby.c')
-rw-r--r--src/plugins/ruby/weechat-ruby.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c
index 5386f7759..a5bc4d0de 100644
--- a/src/plugins/ruby/weechat-ruby.c
+++ b/src/plugins/ruby/weechat-ruby.c
@@ -69,6 +69,7 @@ struct t_plugin_script_data ruby_data;
struct t_config_file *ruby_config_file = NULL;
struct t_config_option *ruby_config_look_check_license = NULL;
+struct t_config_option *ruby_config_look_eval_keep_context = NULL;
int ruby_quiet = 0;
int ruby_hide_errors = 0;
@@ -894,6 +895,12 @@ weechat_ruby_eval (struct t_gui_buffer *buffer, int send_to_buffer_as_input,
ruby_eval_exec_commands = 0;
ruby_eval_buffer = NULL;
+ if (!weechat_config_boolean (ruby_config_look_eval_keep_context))
+ {
+ weechat_ruby_unload (ruby_script_eval);
+ ruby_script_eval = NULL;
+ }
+
return 1;
}
@@ -1367,6 +1374,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
ruby_data.config_file = &ruby_config_file;
ruby_data.config_look_check_license = &ruby_config_look_check_license;
+ ruby_data.config_look_eval_keep_context = &ruby_config_look_eval_keep_context;
ruby_data.scripts = &ruby_scripts;
ruby_data.last_script = &last_ruby_script;
ruby_data.callback_command = &weechat_ruby_command_cb;