From 8e16dcf2a2daf92d749c190bcb575012fc73b466 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sun, 15 Oct 2023 12:16:55 +0200 Subject: [PATCH] console.lua: complete profiles --- player/lua/console.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/player/lua/console.lua b/player/lua/console.lua index f47ef15c3e..ec486639d6 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -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 = '}' }, }