MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / RunString

Method RunString

src/LuaExtension.cpp:752–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

750}
751
752bool LuaExtension::RunString(const char *s) {
753 if (luaState || InitGlobalScope()) {
754 int status = luaL_loadbuffer(luaState, s, strlen(s), "=File");
755
756 if (status == LUA_OK) {
757 status = lua_pcall(luaState, 0, LUA_MULTRET, 0);
758 }
759
760 if (status != LUA_OK) {
761 // Print an error message
762 hostTraceError(lua_tostring(luaState, -1));
763 hostTraceError("\n");
764 lua_settop(luaState, 0); /* clear stack */
765 return false;
766 }
767
768 lua_settop(luaState, 0); /* clear stack */
769 }
770
771 return true;
772}
773
774bool LuaExtension::OnExecute(const char *s) {
775 static bool isFirstLine = true;

Callers

nothing calls this directly

Calls 2

InitGlobalScopeFunction · 0.85
hostTraceErrorFunction · 0.85

Tested by

no test coverage detected