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.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/textadept.c') diff --git a/src/textadept.c b/src/textadept.c index 6a5122f9..adeb89cb 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -20,7 +20,7 @@ static bool w_exit(GtkWidget*, GdkEventAny*, gpointer); int main(int argc, char **argv) { gtk_init(&argc, &argv); - l_init(argc, argv); + l_init(argc, argv, false); create_ui(); l_load_script("init.lua"); gtk_main(); -- cgit v1.2.3