Move chatterino global namespace shit into a namespace

This commit is contained in:
Mm2PL 2023-02-01 22:40:36 +01:00
parent 13d2ff870f
commit 3ee84ff444
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9

View file

@ -341,7 +341,13 @@ static const luaL_Reg C2LIB[] = {
void PluginController::loadChatterinoLib(lua_State *L) void PluginController::loadChatterinoLib(lua_State *L)
{ {
lua_pushglobaltable(L); lua_pushglobaltable(L);
auto global = lua_gettop(L);
// count of elements in C2LIB - 1 (to account for terminator)
lua::pushEmptyTable(L, 3);
luaL_setfuncs(L, C2LIB, 0); luaL_setfuncs(L, C2LIB, 0);
lua_setfield(L, global, "c2");
} }
bool PluginController::isEnabled(const QString &codename) bool PluginController::isEnabled(const QString &codename)