Skip to content

Commit

Permalink
fix: keybinds menu not listing mpv-menu-plugin keyless syntax com…
Browse files Browse the repository at this point in the history
…mands

ref #901
  • Loading branch information
tomasklaen committed May 7, 2024
1 parent d4b1343 commit 2940352
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/uosc/lib/menus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,19 @@ end
-- Adapted from `stats.lua`
function get_keybinds_items()
local items = {}
-- uosc and mpv-menu-plugin binds with no keys
local no_key_menu_binds = itable_filter(
get_all_user_bindings(),
function(b) return b.is_menu_item and b.key == '#' end
function(b) return b.is_menu_item and b.key == '#' or b.key == '_' end
)
local binds_dump = itable_join(find_active_keybindings(), no_key_menu_binds)
local ids = {}

-- Convert to menu items
for _, bind in pairs(binds_dump) do
if bind.cmd ~= 'ignore' then
local id = bind.key .. '<>' .. bind.cmd
if not ids[id] and bind.cmd ~= 'ignore' then
ids[id] = true
items[#items + 1] = {title = bind.cmd, hint = bind.key, value = bind.cmd}
end
end
Expand Down

0 comments on commit 2940352

Please # to comment.