diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -508,6 +508,26 @@ local function favourite_option() update_osd() end +local function goto_option() + local menu = menus[depth] + local opt = menu.options[menu.cursor] + if not opt or not opt.path then + return + end + + for i = 1, #opt.path do + push_group_menu(opt.path[i]) + + local target = i == #opt.path and opt or opt.path[i+1] + for i, v in ipairs(menus[depth].options) do + if v.id == target.id then + set_cursor(i, true) + break + end + end + end +end + local function search_menu_options_build(options, t, path) local menu = menus[depth] local path = path or {} @@ -735,6 +755,7 @@ function bind_menu_keys() bind_key('ENTER', select_option) bind_key('Ctrl+f', favourite_option) + bind_key('g', goto_option) bind_key('UP', cursor_up, {repeatable=true}) bind_key('DOWN', cursor_down, {repeatable=true}) |