This is how SciTEStartup.lua is currently loaded and executed:
luaL_loadfile(luaState, startupScript.c_str());
if (!call_function(luaState, 0, true)) {
host->Trace(">Lua: error occurred while loading startup script\n");
}
If an error occurs during the luaL_loadfile call (e.g. syntax error, OOM), the top of the stack contains a string (the error message) instead of the Lua code chunk. This causes the next line to attempt to call a string, resulting in this confusing error message:
attempt to call a string value
>Lua: error occurred while loading startup script
I'm not sure whether to use the Lua
printfunction or to directlyhost->Tracethe string; this patch uses the latter. Feel free to tweak it.Committed as [a9f6d5].
Can't see any benefit from using print over Trace.
Related
Commit: [a9f6d5]