feat: added menu keybinds to move and delete items in playlists

`ctrl+up/down` moves a selected item up/down, and `del` deletes it.
This commit is contained in:
tomasklaen
2023-02-20 16:12:22 +01:00
parent 2e5b0cc834
commit f039af5732
4 changed files with 48 additions and 12 deletions

View File

@@ -858,6 +858,10 @@ bind_command('playlist', create_self_updating_menu_opener({
return items
end,
on_select = function(index) mp.commandv('set', 'playlist-pos-1', tostring(index)) end,
on_move_item = function(from, to)
mp.commandv('playlist-move', tostring(math.max(from, to) - 1), tostring(math.min(from, to) - 1))
end,
on_delete_item = function(index) mp.commandv('playlist-remove', tostring(index - 1)) end,
}))
bind_command('chapters', create_self_updating_menu_opener({
title = 'Chapters',