LuaAppendCmd

This commit is contained in:
Krzosa Karol
2024-08-09 09:46:16 +02:00
parent 68ff6dc2b5
commit 47ec2b55c7

View File

@@ -91,7 +91,15 @@ void Open(String16 path) {
Open(string); Open(string);
} }
int LuaExec(lua_State *L) { int LuaAppendCmd(lua_State *L) {
String string = lua_tostring(L, 1);
lua_pop(L, 1);
String working_dir = GetCurrentBufferDir();
Exec(ConsoleViewID, true, string, working_dir);
return 0;
}
int LuaNewCmd(lua_State *L) {
String string = lua_tostring(L, 1); String string = lua_tostring(L, 1);
lua_pop(L, 1); lua_pop(L, 1);
@@ -203,7 +211,8 @@ luaL_Reg LuaFunctions[] = {
{ "print", LuaPrint}, { "print", LuaPrint},
{ "Print", LuaPrint}, { "Print", LuaPrint},
{ "Kill", LuaKill}, { "Kill", LuaKill},
{ "c", LuaExec}, { "NewC", LuaNewCmd},
{ "AppendC", LuaAppendCmd},
{ NULL, NULL}, { NULL, NULL},
}; };