mirror of https://github.com/mpv-player/mpv
console.lua: fix completing change-list ao/vo/gpu-context remove
The value of list options is a table not just for vf and af but for all object settings lists. Extract just the names from the tables returned when retrieving these options.
This commit is contained in:
parent
3f83671f20
commit
d3800a67fc
|
@ -1050,17 +1050,21 @@ local function list_option_action_list(option)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function list_option_value_list(option)
|
local function list_option_value_list(option)
|
||||||
if option ~= 'af' and option ~= 'vf' then
|
local values = mp.get_property_native(option)
|
||||||
return mp.get_property_native(option)
|
|
||||||
|
if type(values) ~= 'table' then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local filters = {}
|
if type(values[1]) ~= 'table' then
|
||||||
|
return values
|
||||||
for i, filter in ipairs(mp.get_property_native(option)) do
|
|
||||||
filters[i] = filter.label and '@' .. filter.label or filter.name
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return filters
|
for i, value in ipairs(values) do
|
||||||
|
values[i] = value.label and '@' .. value.label or value.name
|
||||||
|
end
|
||||||
|
|
||||||
|
return values
|
||||||
end
|
end
|
||||||
|
|
||||||
local function has_file_argument(candidate_command)
|
local function has_file_argument(candidate_command)
|
||||||
|
|
Loading…
Reference in New Issue