From 655d3222b8e242bcdb96e9458dc311aee1a658e5 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 3 Feb 2008 16:45:32 -0500 Subject: Added textadept.reset() function for resetting the Lua state. The l_init function takes an additional reinit boolean as a result. When resetting, the package.loaded and _G tables are cleared. Since the textadept.buffers, textadept.views, and arg tables were originally in _G, they were moved to the LUA_REGISTRYINDEX table so as not to be lost. They are still available in _G, but as links to the tables in LUA_REGISTRYINDEX. textadept.reset() sets a global RESETTING boolean to true when init.lua is re-run so things like reloading a session or reloading files from the command line do not occur. The boolean is set to nil afterwards. --- src/textadept.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/textadept.h') diff --git a/src/textadept.h b/src/textadept.h index af53d0f9..5a6309a3 100644 --- a/src/textadept.h +++ b/src/textadept.h @@ -54,7 +54,7 @@ void set_docstatusbar_text(const char *text); void command_toggle_focus(); // lua_interface.c -void l_init(int argc, char **argv); +void l_init(int argc, char **argv, bool reinit); void l_close(); void l_load_script(const char *script_file); void l_add_scintilla_window(GtkWidget *editor); -- cgit v1.2.3