diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2018-05-27 15:23:23 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2018-05-27 15:23:23 -0400 |
commit | 9b8226101ce2c0657d5555de23d09be2aa146a4b (patch) | |
tree | 99c7759a35ae96ac0d323c31b2a35d6931dc71af /src/textadept.c | |
parent | 0504c787eb15a0e0b83048deb5cfdf4fc8878921 (diff) |
Refer to Lua's 'package.loaded' table name by constant, not literal.
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/textadept.c b/src/textadept.c index 3433a149..afbb7ee7 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1492,10 +1492,10 @@ static int lL_init(lua_State *L, int argc, char **argv, int reinit) { lua_setfield(L, LUA_REGISTRYINDEX, "ta_arg"); lua_newtable(L), lua_setfield(L, LUA_REGISTRYINDEX, "ta_buffers"); lua_newtable(L), lua_setfield(L, LUA_REGISTRYINDEX, "ta_views"); - } else { // clear _LOADED and _G - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + } else { // clear package.loaded and _G + lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); lL_cleartable(L, lua_gettop(L)); - lua_pop(L, 1); // _LOADED + lua_pop(L, 1); // package.loaded lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS); lL_cleartable(L, lua_gettop(L)); lua_pop(L, 1); // _G |