1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

console.lua: complete profiles

This commit is contained in:
Guido Cella 2023-10-15 12:16:55 +02:00 committed by Dudemanguy
parent e1ca04274d
commit 8e16dcf2a2

View File

@ -659,6 +659,16 @@ local function property_list()
return properties
end
local function profile_list()
local profiles = {}
for i, profile in ipairs(mp.get_property_native('profile-list')) do
profiles[i] = profile.name
end
return profiles
end
local function choice_list(option)
local info = mp.get_property_native('option-info/' .. option, {})
@ -687,6 +697,8 @@ function build_completers()
{ pattern = '^%s*set%s+"?([%w_-]+)"?%s+"()%S*$', list = choice_list, append = '"' },
{ pattern = '^%s*cycle[-_]values%s+"?([%w_-]+)"?.-%s+()%S*$', list = choice_list, append = " " },
{ pattern = '^%s*cycle[-_]values%s+"?([%w_-]+)"?.-%s+"()%S*$', list = choice_list, append = '" ' },
{ pattern = '^%s*apply[-_]profile%s+"()%S*$', list = profile_list, append = '"' },
{ pattern = '^%s*apply[-_]profile%s+()%S*$', list = profile_list },
{ pattern = '${()[%w_/-]+$', list = property_list, append = '}' },
}