summaryrefslogtreecommitdiff
path: root/src/plugins/lua
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/lua
parent21e63e7958c499b79a63612d7344ad4d53bd4284 (diff)
downloadweechat-8fbbe8b0d509df26ff86ca8cd7fe4b2205c6d15e.zip
scripts: add option "eval_keep_context" in script plugins
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/weechat-lua.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c
index eca71c60a..1fe13133f 100644
--- a/src/plugins/lua/weechat-lua.c
+++ b/src/plugins/lua/weechat-lua.c
@@ -48,6 +48,7 @@ struct t_plugin_script_data lua_data;
struct t_config_file *lua_config_file = NULL;
struct t_config_option *lua_config_look_check_license = NULL;
+struct t_config_option *lua_config_look_eval_keep_context = NULL;
int lua_quiet = 0;
@@ -849,6 +850,12 @@ weechat_lua_eval (struct t_gui_buffer *buffer, int send_to_buffer_as_input,
lua_eval_exec_commands = 0;
lua_eval_buffer = NULL;
+ if (!weechat_config_boolean (lua_config_look_eval_keep_context))
+ {
+ weechat_lua_unload (lua_script_eval);
+ lua_script_eval = NULL;
+ }
+
return 1;
}
@@ -1218,6 +1225,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
lua_data.config_file = &lua_config_file;
lua_data.config_look_check_license = &lua_config_look_check_license;
+ lua_data.config_look_eval_keep_context = &lua_config_look_eval_keep_context;
lua_data.scripts = &lua_scripts;
lua_data.last_script = &last_lua_script;
lua_data.callback_command = &weechat_lua_command_cb;