Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/67670dd000c5ef2d189f5e42c3c2ced7f18857be
>---------------------------------------------------------------
commit 67670dd000c5ef2d189f5e42c3c2ced7f18857be
Author: Vadim Yegorov <
z...@bmg.lv>
Date: Sun Sep 28 23:13:46 2025 +0300
luamacro:
1. Menu.GetItemExtendedData now has 1st optional parameter: dialog handle.
>---------------------------------------------------------------
67670dd000c5ef2d189f5e42c3c2ced7f18857be
plugins/luamacro/_globalinfo.lua | 4 ++--
plugins/luamacro/changelog | 4 ++++
plugins/luamacro/luafar/lf_service.c | 25 +++++++++++++++++++++++++
plugins/luamacro/luafar/lf_version.h | 2 +-
4 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index 1147fccd0..d6380e63c 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,7 +1,7 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 895 },
- MinFarVersion = { 3, 0, 0, 6546 },
+ Version = { 3, 0, 0, 896 },
+ MinFarVersion = { 3, 0, 0, 6564 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Description = "Far macros in Lua",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index 9bf6c2127..7c294b872 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,7 @@
+zg 2025-09-28 23:12:02+03:00 - build 896
+
+1. Menu.GetItemExtendedData now has 1st optional parameter: dialog handle.
+
shmuel 2025-09-28 15:08:34+03:00 - build 895
1. LuaFAR: refactoring.
diff --git a/plugins/luamacro/luafar/lf_service.c b/plugins/luamacro/luafar/lf_service.c
index 107c90c3d..19eb803dc 100644
--- a/plugins/luamacro/luafar/lf_service.c
+++ b/plugins/luamacro/luafar/lf_service.c
@@ -417,9 +417,29 @@ static int PluginHandle_rawhandle(lua_State *L)
return 1;
}
+static int Dialog_getvalue(lua_State *L, int pos, HANDLE *target)
+{
+ if (lua_type(L, pos) == LUA_TUSERDATA)
+ {
+ int equal;
+ lua_getmetatable(L, pos);
+ luaL_getmetatable(L, FarDialogType);
+ equal = lua_rawequal(L, -1, -2);
+ lua_pop(L, 2);
+ if (equal && target)
+ {
+ *target = ((TDialogData*)lua_touserdata(L, pos))->hDlg;
+ equal = *target != INVALID_HANDLE_VALUE;
+ }
+ return equal;
+ }
+ return 0;
+}
+
void ConvertLuaValue (lua_State *L, int pos, struct FarMacroValue *target)
{
INT64 val64;
+ HANDLE val_handle;
int type = lua_type(L, pos);
pos = abs_index(L, pos);
target->Type = FMVT_UNKNOWN;
@@ -463,6 +483,11 @@ void ConvertLuaValue (lua_State *L, int pos, struct FarMacroValue *target)
target->Type = FMVT_INTEGER;
target->Value.Integer = val64;
}
+ else if (Dialog_getvalue(L, pos, &val_handle))
+ {
+ target->Type = FMVT_DIALOG;
+ target->Value.Pointer = val_handle;
+ }
}
static int far_GetFileOwner(lua_State *L)
diff --git a/plugins/luamacro/luafar/lf_version.h b/plugins/luamacro/luafar/lf_version.h
index d91663263..c477063ab 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 895
+#define PLUGIN_BUILD 896