Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/81fc615d18f1082e4db116f6ecc893106939db56
>---------------------------------------------------------------
commit 81fc615d18f1082e4db116f6ecc893106939db56
Author: Shmuel Zeigerman <
solo...@gmail.com>
Date: Fri May 8 15:23:57 2026 +0300
LuaFAR: refactoring
>---------------------------------------------------------------
81fc615d18f1082e4db116f6ecc893106939db56
plugins/luamacro/_globalinfo.lua | 2 +-
plugins/luamacro/changelog | 4 ++++
plugins/luamacro/luafar/lf_exported.c | 29 ++++++++++++-----------------
plugins/luamacro/luafar/lf_version.h | 2 +-
4 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index 744842e35..4801e872b 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 925 },
+ Version = { 3, 0, 0, 926 },
MinFarVersion = { 3, 0, 0, 6678 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index 62fd23bcd..bf9c04ddd 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,7 @@
+shmuel 2026-05-08 15:23:15+03:00 - build 926
+
+1. LuaFAR: refactoring.
+
shmuel 2026-05-07 14:49:36+03:00 - build 925
1. LuaFAR: refactoring.
diff --git a/plugins/luamacro/luafar/lf_exported.c b/plugins/luamacro/luafar/lf_exported.c
index eb6a18194..5aa7f7832 100644
--- a/plugins/luamacro/luafar/lf_exported.c
+++ b/plugins/luamacro/luafar/lf_exported.c
@@ -917,9 +917,11 @@ static void push_guid(lua_State *L, const void *pGuid)
HANDLE LF_Open(lua_State* L, const struct OpenInfo *Info)
{
FP_PROTECT();
+ int entry_top = lua_gettop(L);
+ HANDLE Result = NULL;
if (!CheckReloadDefaultScript(L) || !GetExportFunction(L, "Open"))
- return NULL;
+ return Result;
if (Info->OpenFrom == OPEN_LUAMACRO)
return Open_Luamacro(L, Info);
@@ -986,17 +988,13 @@ HANDLE LF_Open(lua_State* L, const struct OpenInfo *Info)
struct FarMacroCall* fmc = CreateFarMacroCall(1);
fmc->Values[0].Type = FMVT_PANEL;
fmc->Values[0].Value.Pointer = RegisterObject(L); // nret
- lua_pop(L,nret); // +0
- return fmc;
+ Result = fmc;
}
- lua_pop(L,nret+1); // +0
- return NULL;
+ goto Exit;
}
lua_pop(L,1); // nret
}
- HANDLE hndl = FillFarMacroCall(L,nret);
- lua_pop(L,nret);
- return hndl;
+ Result = FillFarMacroCall(L,nret);
}
}
else
@@ -1004,18 +1002,15 @@ HANDLE LF_Open(lua_State* L, const struct OpenInfo *Info)
if (pcall_msg(L, 3, 1) == 0)
{
if (lua_type(L,-1) == LUA_TNUMBER && lua_tonumber(L,-1) == -1)
- {
- lua_pop(L,1);
- return PANEL_STOP;
- }
- else if (lua_toboolean(L, -1)) //+1: Obj
- return RegisterObject(L); //+0
-
- lua_pop(L,1);
+ Result = PANEL_STOP;
+ else if (lua_toboolean(L, -1))
+ Result = RegisterObject(L);
}
}
- return NULL;
+Exit:
+ lua_settop(L, entry_top);
+ return Result;
}
void LF_ClosePanel(lua_State* L, const struct ClosePanelInfo *Info)
diff --git a/plugins/luamacro/luafar/lf_version.h b/plugins/luamacro/luafar/lf_version.h
index b4ac2cc6b..87f009a5f 100644
--- a/plugins/luamacro/luafar/lf_version.h
+++ b/plugins/luamacro/luafar/lf_version.h
@@ -1,3 +1,3 @@
#include <farversion.hpp>
-#define PLUGIN_BUILD 925
+#define PLUGIN_BUILD 926