Работает в автодополнении, во всех меню (включая Главное и Пользовательское), в историях, листбоксах диалогов (на всякий случай).
Code: Select all
--http://forum.farmanager.com/viewtopic.php?f=15&t=9596
local F = far.Flags
local areas = "ShellAutoCompletion DialogAutoCompletion Menu UserMenu MainMenu Dialog"
local DELAY = 300
local function Jump(dir)
local hDlg = far.AdvControl(F.ACTL_GETWINDOWINFO).Id
local list = far.GetDlgItem(hDlg,1)[6]
for i=list.SelectIndex+dir,dir<0 and 1 or #list, dir do
if band(list[i].Flags,F.LIF_SEPARATOR)~=0 or i==1 then
hDlg:send(F.DM_LISTSETCURPOS,1,{SelectPos=i,TopPos=i})
return
end
end
if mf.waitkey(DELAY)==mf.akey(1,1) then
Keys(dir>0 and "Home" or "End")
else
mf.beep()
end
end
Macro { description="Navigate to prev/next section";
area=areas; key="/[LR]CtrlShift(Up|Down)/";
id="1BAED6ED-E6F0-4313-BDC3-F8466BEEDB68";
condition=function()
return not Area.Dialog or (Dlg.ItemType==F.DI_LISTBOX)
end;
action=function()
if Area.MainMenu and Object.Height==1 then
Keys "Up"
else
Jump(mf.akey(1,1):match"Up$" and -1 or 1)
end
end;
}