[FarGroup/FarManager] master: LuaFAR: far.Show processes Ctrl+C and Ctrl+Ins (cf70c4ff4)

2 views
Skip to first unread message

farg...@farmanager.com

unread,
Dec 30, 2025, 5:45:54 PM12/30/25
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/cf70c4ff41060e4bc4650dece18de3e1fe2cb550

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

commit cf70c4ff41060e4bc4650dece18de3e1fe2cb550
Author: Shmuel Zeigerman <solo...@gmail.com>
Date: Wed Dec 31 00:33:45 2025 +0200

LuaFAR: far.Show processes Ctrl+C and Ctrl+Ins


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

cf70c4ff41060e4bc4650dece18de3e1fe2cb550
enc/enc_lua/luafar_manual.tsi | 4 +++-
plugins/luamacro/_globalinfo.lua | 2 +-
plugins/luamacro/changelog | 4 ++++
plugins/luamacro/luafar/lf_service.c | 11 +++++++----
plugins/luamacro/luafar/lf_version.h | 2 +-
5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/enc/enc_lua/luafar_manual.tsi b/enc/enc_lua/luafar_manual.tsi
index 88c2adbda..0677e3833 100644
--- a/enc/enc_lua/luafar_manual.tsi
+++ b/enc/enc_lua/luafar_manual.tsi
@@ -8951,7 +8951,7 @@ lv=2
dt=Text
nm=far.Show
ctime=3476617735
-mtime=3599756101
+mtime=3976301768
<article>
#_Item, Position = far.Show (...)
#_
@@ -8972,6 +8972,8 @@ mtime=3599756101
#_ Due to using `far.MakeMenuItems` the returned *Item* table contains
#_ the value of the corresponding original argument under the field 'arg'.
#_
+#_ *Ctrl+C* and *Ctrl+Ins* copy the selected line to clipboard and close the menu.
+#_
#_@@@
#_[far.Menu]: 64.html
#_[far.MakeMenuItems]: 280.html
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index a0da86308..e82ed6768 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 910 },
+ Version = { 3, 0, 0, 911 },
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 9597ce077..526825891 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,7 @@
+shmuel 2025-12-31 00:30:52+02:00 - build 911
+
+1. far.Show: CtrlC and CtrlIns copy the selected line to clipboard and close the menu.
+
shmuel 2025-12-26 21:33:02+02:00 - build 910

1. LuaFAR (DM_ENABLEREDRAW, DM_ENABLE):
diff --git a/plugins/luamacro/luafar/lf_service.c b/plugins/luamacro/luafar/lf_service.c
index 4001d64a6..ad83a902c 100644
--- a/plugins/luamacro/luafar/lf_service.c
+++ b/plugins/luamacro/luafar/lf_service.c
@@ -5420,10 +5420,13 @@ static int far_MakeMenuItems(lua_State *L)
static int far_Show(lua_State *L)
{
const char* f =
- "local items,n=...\n"
- "local bottom=n==0 and 'No arguments' or n==1 and '1 argument' or n..' arguments'\n"
- "return far.Menu({Title='',Bottom=bottom,Flags='FMENU_SHOWAMPERSAND FMENU_WRAPMODE'},items,"
- "{{BreakKey='SPACE'}})";
+ "local items, n = ...\n"
+ "local bot = n==0 and 'No arguments' or n==1 and '1 argument' or n..' arguments'\n"
+ "local it, pos = far.Menu({Title=''; Bottom=bot; Flags='FMENU_SHOWAMPERSAND FMENU_WRAPMODE'},\n"
+ " items, 'Space CtrlC CtrlIns')\n"
+ "if items[pos] and (it.BreakKey=='CtrlC' or it.BreakKey=='CtrlIns') then\n"
+ " far.CopyToClipboard(tostring(items[pos].arg)) end\n"
+ "return it, pos";
int argn = lua_gettop(L);
far_MakeMenuItems(L);

diff --git a/plugins/luamacro/luafar/lf_version.h b/plugins/luamacro/luafar/lf_version.h
index 71ac04481..a31e9fb19 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 910
+#define PLUGIN_BUILD 911


Reply all
Reply to author
Forward
0 new messages