diff options
author | 2008-02-03 16:45:32 -0500 | |
---|---|---|
committer | 2008-02-03 16:45:32 -0500 | |
commit | 655d3222b8e242bcdb96e9458dc311aee1a658e5 (patch) | |
tree | 9f1d643b137e2ea967ffad5ce16aad7fa8f9f1bb /src/textadept.h | |
parent | bc000dc1ea565efb81a2a3d4b7e6aa41c376c0fb (diff) | |
download | textadept-655d3222b8e242bcdb96e9458dc311aee1a658e5.tar.gz textadept-655d3222b8e242bcdb96e9458dc311aee1a658e5.zip |
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.
Diffstat (limited to 'src/textadept.h')
-rw-r--r-- | src/textadept.h | 2 |
1 files changed, 1 insertions, 1 deletions
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); |