Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/2683f686b5560ef89f01ae5ab2633697ea96319c
>---------------------------------------------------------------
commit 2683f686b5560ef89f01ae5ab2633697ea96319c
Author: johnd0e <
1838643...@users.noreply.github.com>
Date: Sun Sep 28 19:55:37 2025 +0200
Fix Mantis #4084 (#1015)
>---------------------------------------------------------------
2683f686b5560ef89f01ae5ab2633697ea96319c
extra/Addons/Macros/Panel.JumpToSelectedFile.lua | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/extra/Addons/Macros/Panel.JumpToSelectedFile.lua b/extra/Addons/Macros/Panel.JumpToSelectedFile.lua
index 969094613..c87246e63 100644
--- a/extra/Addons/Macros/Panel.JumpToSelectedFile.lua
+++ b/extra/Addons/Macros/Panel.JumpToSelectedFile.lua
@@ -2,12 +2,14 @@ local cyclic = true -- set false to disable cyclic jump
local is_selected = 8
local function JumpToSelected (from, to)
- for pos=from,to,from<to and 1 or -1 do
- if Panel.Item(0,pos,is_selected) then return Panel.SetPosIdx(0,pos) end
+ if from>0 and from<=APanel.ItemCount then
+ for pos=from,to,from<to and 1 or -1 do
+ if Panel.Item(0,pos,is_selected) then return Panel.SetPosIdx(0,pos) end
+ end
end
if cyclic then
mf.beep()
- JumpToSelected(APanel.ItemCount-to,to)
+ JumpToSelected(APanel.ItemCount-to+1,to)
end
end