From 86c8ef5c1f78b6a618dbd2df59aa2d9f2ece6e32 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Tue, 5 Dec 2023 23:22:13 +0100 Subject: [PATCH] console.lua: complete current-tracks sub-properties Also inline option-info's sub-properties so we don't have to define sub-properties at the top of the function for every one we decide to complete. --- player/lua/console.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/player/lua/console.lua b/player/lua/console.lua index ef1a43a710..ca065b853e 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -742,19 +742,21 @@ local function command_list_and_help() end local function property_list() - local option_info = { - 'name', 'type', 'set-from-commandline', 'set-locally', 'default-value', - 'min', 'max', 'choices', - } - local properties = mp.get_property_native('property-list') + for _, sub_property in pairs({'video', 'audio', 'sub', 'sub2'}) do + properties[#properties + 1] = 'current-tracks/' .. sub_property + end + for _, option in ipairs(mp.get_property_native('options')) do properties[#properties + 1] = 'options/' .. option properties[#properties + 1] = 'file-local-options/' .. option properties[#properties + 1] = 'option-info/' .. option - for _, sub_property in ipairs(option_info) do + for _, sub_property in pairs({ + 'name', 'type', 'set-from-commandline', 'set-locally', + 'default-value', 'min', 'max', 'choices', + }) do properties[#properties + 1] = 'option-info/' .. option .. '/' .. sub_property end