summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2023-12-05 23:22:13 +0100
committerDudemanguy <random342@airmail.cc>2023-12-15 15:45:00 +0000
commit86c8ef5c1f78b6a618dbd2df59aa2d9f2ece6e32 (patch)
tree6ae065f24cbd3a8a7965677ffb7b273e80dc0e62 /player/lua
parentb09deda37a068fb5b88f8dfaaf579b87079eae82 (diff)
downloadmpv-86c8ef5c1f78b6a618dbd2df59aa2d9f2ece6e32.tar.bz2
mpv-86c8ef5c1f78b6a618dbd2df59aa2d9f2ece6e32.tar.xz
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.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/console.lua14
1 files 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