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
1050end1050end
1051 1051
1052local function list_option_value_list(option)1052local function list_option_value_list(option)
1053 if option ~= 'af' and option ~= 'vf' then1053 local values = mp.get_property_native(option)
1054 return mp.get_property_native(option)1054
1055 if type(values) ~= 'table' then
1056 return
1055 end1057 end
1056 1058
1057 local filters = {}1059 if type(values[1]) ~= 'table' then
1060 return values
1061 end
1058 1062
1059 for i, filter in ipairs(mp.get_property_native(option)) do1063 for i, value in ipairs(values) do
1060 filters[i] = filter.label and '@' .. filter.label or filter.name1064 values[i] = value.label and '@' .. value.label or value.name
1061 end1065 end
1062 1066
1063 return filters1067 return values
1064end1068end
1065 1069
1066local function has_file_argument(candidate_command)1070local 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