[FarGroup/FarManager] master: LuaFAR (DM_ENABLEREDRAW, DM_REDRAW): (b5bdf6909)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Dec 26, 2025, 2:45:55 PM (15 hours ago) Dec 26
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/b5bdf6909f5ec620689568d53eb2e4f7aff57b76

>---------------------------------------------------------------

commit b5bdf6909f5ec620689568d53eb2e4f7aff57b76
Author: Shmuel Zeigerman <solo...@gmail.com>
Date: Fri Dec 26 21:38:34 2025 +0200

LuaFAR (DM_ENABLEREDRAW, DM_REDRAW):

- change the default value of the setting parameter from 0 to -1
- the setting parameter can be either integer or boolean


>---------------------------------------------------------------

b5bdf6909f5ec620689568d53eb2e4f7aff57b76
enc/enc_lua/luafar_manual.tsi | 13 ++++++++++---
plugins/luamacro/_globalinfo.lua | 2 +-
plugins/luamacro/changelog | 6 ++++++
plugins/luamacro/luafar/lf_service.c | 27 ++++++++++++++++++++++++---
plugins/luamacro/luafar/lf_version.h | 2 +-
5 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/enc/enc_lua/luafar_manual.tsi b/enc/enc_lua/luafar_manual.tsi
index 5e1c7ad3e..88c2adbda 100644
--- a/enc/enc_lua/luafar_manual.tsi
+++ b/enc/enc_lua/luafar_manual.tsi
@@ -2611,7 +2611,7 @@ id=71
lv=2
dt=Text
nm=far.SendDlgMessage
-mtime=3921264341
+mtime=3975946037
<article>
#_Result = far.SendDlgMessage (hDlg, Msg, Param1, Param2)
#_ or
@@ -2630,8 +2630,6 @@ mtime=3921264341
#_
#_DM_CLOSE,
#_DM_EDITUNCHANGEDFLAG,
-#_DM_ENABLE,
-#_DM_ENABLEREDRAW,
#_DM_GETCHECK,
#_DM_GETCURSORSIZE,
#_DM_GETDROPDOWNOPENED,
@@ -2654,6 +2652,15 @@ mtime=3921264341
#_ Param2: integer
#_ Result: integer
#_
+#_DM_ENABLE:
+#_ Param2: boolean or integer (default = -1)
+#_ Result: integer
+#_
+#_DM_ENABLEREDRAW:
+#_ Param1: boolean or integer (default = -1)
+#_ Param2: ignored
+#_ Result: integer
+#_
#_DM_ADDHISTORY,
#_DM_LISTADDSTR,
#_DM_SETHISTORY,
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index d6b518245..a0da86308 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 909 },
+ Version = { 3, 0, 0, 910 },
MinFarVersion = { 3, 0, 0, 6564 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index a50d6861b..7785d14f2 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,9 @@
+shmuel 2025-12-26 21:33:02+02:00 - build 910
+
+1. LuaFAR (DM_ENABLEREDRAW, DM_REDRAW):
+ - change the default value of the setting parameter from 0 to -1
+ - the setting parameter can be either integer or boolean
+
shmuel 2025-12-05 18:44:38+02:00 - build 909

1. LuaFAR (regex): fix a corner case.
diff --git a/plugins/luamacro/luafar/lf_service.c b/plugins/luamacro/luafar/lf_service.c
index f934d4335..4001d64a6 100644
--- a/plugins/luamacro/luafar/lf_service.c
+++ b/plugins/luamacro/luafar/lf_service.c
@@ -3125,6 +3125,18 @@ int PushDMParams (lua_State *L, intptr_t Msg, intptr_t Param1)
return 1;
}

+static intptr_t GetEnableFromLua (lua_State *L, int pos)
+{
+ intptr_t ret;
+ if (lua_isnoneornil(L,pos)) //get state
+ ret = -1;
+ else if (lua_isnumber(L,pos))
+ ret = lua_tointeger(L, pos);
+ else
+ ret = lua_toboolean(L, pos);
+ return ret;
+}
+
static int DoSendDlgMessage (lua_State *L, intptr_t Msg, int delta)
{
typedef struct { void *Id; int Ref; } listdata_t;
@@ -3151,11 +3163,14 @@ static int DoSendDlgMessage (lua_State *L, intptr_t Msg, int delta)
if (Param1>0) --Param1;
break;

+ case DM_ENABLEREDRAW:
+ Param1 = GetEnableFromLua(L,pos3);
+ break;
+
case DM_GETDLGDATA:
case DM_SETDLGDATA:
break;

- case DM_ENABLEREDRAW:
case DM_GETDIALOGINFO:
case DM_GETDIALOGTITLE:
case DM_GETDLGRECT:
@@ -3193,6 +3208,7 @@ static int DoSendDlgMessage (lua_State *L, intptr_t Msg, int delta)
break;
}

+ // Param2 and the rest
switch(Msg)
{
default:
@@ -3201,8 +3217,6 @@ static int DoSendDlgMessage (lua_State *L, intptr_t Msg, int delta)

case DM_CLOSE:
case DM_EDITUNCHANGEDFLAG:
- case DM_ENABLE:
- case DM_ENABLEREDRAW:
case DM_GETCHECK:
case DM_GETCOMBOBOXEVENT:
case DM_GETCURSORSIZE:
@@ -3230,6 +3244,13 @@ static int DoSendDlgMessage (lua_State *L, intptr_t Msg, int delta)
Param2 = (void*)(intptr_t)luaL_optint(L,pos4,0);
break;

+ case DM_ENABLEREDRAW:
+ break;
+
+ case DM_ENABLE:
+ Param2 = (void*)GetEnableFromLua(L, pos4);
+ break;
+
case DM_LISTGETDATASIZE:
Param2 = (void*)(intptr_t)(luaL_optint(L,pos4,1) - 1);
break;
diff --git a/plugins/luamacro/luafar/lf_version.h b/plugins/luamacro/luafar/lf_version.h
index 52f39142c..71ac04481 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 909
+#define PLUGIN_BUILD 910


Reply all
Reply to author
Forward
0 new messages