History

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.

Guido Cella committed 2 years ago

Commit d3800a61 parent 3f836711 file · +10 −6Browse files

Unified · Split

player/lua/console.lua+10−6
@@ -1050,17 +1050,21 @@ local function list_option_action_list(option) · 1049 unmodified lines
10501050 end
10511051
10521052 local function list_option_value_list(option)
1053− if option ~= 'af' and option ~= 'vf' then
1054− return mp.get_property_native(option)
1053+ local values = mp.get_property_native(option)
1054+
1055+ if type(values) ~= 'table' then
1056+ return
10551057 end
10561058
1057− local filters = {}
1059+ if type(values[1]) ~= 'table' then
1060+ return values
1061+ end
10581062
1059− for i, filter in ipairs(mp.get_property_native(option)) do
1060− filters[i] = filter.label and '@' .. filter.label or filter.name
1063+ for i, value in ipairs(values) do
1064+ values[i] = value.label and '@' .. value.label or value.name
10611065 end
10621066
1063− return filters
1067+ return values
10641068 end
10651069
10661070 local function has_file_argument(candidate_command)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t