Skip to content

Commit

Permalink
Уточнение revision 15039: порядковые номера - буквы не всегда работал…
Browse files Browse the repository at this point in the history
…и как "горячие клавиши".
  • Loading branch information
shmuz committed Aug 13, 2017
1 parent 848d9c0 commit 334dfc4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
Version = { 1, 0, 0, 611 },
Version = { 1, 0, 0, 612 },
MinFarVersion = { 3, 0, 0, 4996 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Expand Down
6 changes: 5 additions & 1 deletion plugins/luamacro/changelog
@@ -1,4 +1,8 @@
shmuel 07.08.2017 15:25:23 +0200 - build 611
shmuel 13.08.2017 22:15:40 +0200 - build 612

1. Уточнение build 611: порядковые номера - буквы не всегда работали как "горячие клавиши".

shmuel 07.08.2017 15:25:23 +0200 - build 611

1. M#3464: Предложение корректировки формы меню "Исполнить макрос".
Изменение: порядковые номера пунктов не подсвечены, но тем не менее являются "горячими клавишами".
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/luamacro.rc
@@ -1,6 +1,6 @@
#include <farversion.hpp>

#define PLUGIN_BUILD 611
#define PLUGIN_BUILD 612
#define PLUGIN_DESC "Lua Macros for Far Manager"
#define PLUGIN_NAME "LuaMacro"
#define PLUGIN_FILENAME "luamacro.dll"
Expand Down
14 changes: 10 additions & 4 deletions plugins/luamacro/utils.lua
Expand Up @@ -862,17 +862,21 @@ local function GetFromMenu (macrolist, area, key)
return p1>p2 or p1==p2 and far.LStricmp(item1.text, item2.text) < 0
end)

local bkeys = { {BreakKey="A+F4"} }
for i,item in ipairs(menuitems) do
local ch = i<10 and tostring(i) or i<36 and string.char(i+55)
item.text = ch and (ch..". "..item.text) or item.text
if ch then item.AccelKey=ch end
if ch then
item.text = ch..". "..item.text
table.insert(bkeys, {BreakKey=ch, pos=i})
if i>=10 then table.insert(bkeys, {BreakKey=ch:lower(), pos=i}) end
end
end

local props, bkeys = {
local props = {
Title = ("%s: %s | %s"):format(Msg.UtExecuteMacroTitle, area, key),
Bottom = Msg.UtExecuteMacroBottom,
Flags = { FMENU_WRAPMODE=1, FMENU_CHANGECONSOLETITLE=1 },
Id = win.Uuid("165AA6E3-C89B-4F82-A0C5-C309243FD21B") }, { {BreakKey="A+F4"} }
Id = win.Uuid("165AA6E3-C89B-4F82-A0C5-C309243FD21B") }
while true do
local item, pos = far.Menu(props, menuitems, bkeys)
if not item then
Expand All @@ -886,6 +890,8 @@ local function GetFromMenu (macrolist, area, key)
local startline = m.action and debug.getinfo(m.action,"S").linedefined
editor.Editor(m.FileName,nil,nil,nil,nil,nil,nil,startline,nil,65001)
end
elseif item.pos then
return menuitems[item.pos].macro
end
end
end
Expand Down

0 comments on commit 334dfc4

Please sign in to comment.