aboutsummaryrefslogtreecommitdiff
path: root/src/lua_interface.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-06-12 18:45:14 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2010-06-12 18:45:14 -0400
commitf0d698d2c478bf6222fda1ef2fe1fec8b339af93 (patch)
tree00f1b34eb3021460ec45556f2d9a817262a923c5 /src/lua_interface.c
parentf0c0e4d8c11843fb6b5dc4c6f590fa25714ab949 (diff)
downloadtextadept-f0d698d2c478bf6222fda1ef2fe1fec8b339af93.tar.gz
textadept-f0d698d2c478bf6222fda1ef2fe1fec8b339af93.zip
Fixed bug with _BUFFERS and _VIEWS not being updated; src/lua_interface.c
Originally textadept.buffers and textadept.views were accessible through a metatable that pointed to the most up-to-date table.
Diffstat (limited to 'src/lua_interface.c')
-rw-r--r--src/lua_interface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 0003d702..1299d8ef 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -213,7 +213,9 @@ void l_remove_scintilla_window(GtkWidget *editor) {
while (lua_next(lua, -2))
(editor != l_checkview(lua, -1)) ? l_append(lua, -4) : lua_pop(lua, 1);
lua_pop(lua, 1); // views
+ lua_pushvalue(lua, -1);
lua_setfield(lua, LUA_REGISTRYINDEX, "views");
+ lua_setglobal(lua, "_VIEWS");
}
/**
@@ -328,7 +330,9 @@ void l_remove_scintilla_buffer(sptr_t doc) {
while (lua_next(lua, -2))
(doc != l_checkdocpointer(lua, -1)) ? l_append(lua, -4) : lua_pop(lua, 1);
lua_pop(lua, 1); // buffers
+ lua_pushvalue(lua, -1);
lua_setfield(lua, LUA_REGISTRYINDEX, "buffers");
+ lua_setglobal(lua, "_BUFFERS");
}
/**