mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
console: enable completions without a prefix
This way it is possible to get a list of all options or all properties, instead of having to guess the first letter before any suggestions are shown.
This commit is contained in:
parent
386de3f275
commit
bca0b20c09
@ -756,7 +756,7 @@ end
|
|||||||
-- match.
|
-- match.
|
||||||
function build_completers()
|
function build_completers()
|
||||||
local completers = {
|
local completers = {
|
||||||
{ pattern = '^%s*()[%w_-]+$', list = command_list_and_help, append = ' ' },
|
{ pattern = '^%s*()[%w_-]*$', list = command_list_and_help, append = ' ' },
|
||||||
{ pattern = '^%s*help%s+()[%w_-]*$', list = command_list },
|
{ pattern = '^%s*help%s+()[%w_-]*$', list = command_list },
|
||||||
{ pattern = '^%s*set%s+"?([%w_-]+)"?%s+()%S*$', list = choice_list },
|
{ pattern = '^%s*set%s+"?([%w_-]+)"?%s+()%S*$', list = choice_list },
|
||||||
{ pattern = '^%s*set%s+"?([%w_-]+)"?%s+"()%S*$', list = choice_list, append = '"' },
|
{ pattern = '^%s*set%s+"?([%w_-]+)"?%s+"()%S*$', list = choice_list, append = '"' },
|
||||||
@ -770,17 +770,17 @@ function build_completers()
|
|||||||
{ pattern = '^%s*change[-_]list%s+"?([%w_-]+)"?%s+"()%a*$', list = list_option_verb_list, append = '" ' },
|
{ pattern = '^%s*change[-_]list%s+"?([%w_-]+)"?%s+"()%a*$', list = list_option_verb_list, append = '" ' },
|
||||||
{ pattern = '^%s*([av]f)%s+()%a*$', list = list_option_verb_list, append = ' ' },
|
{ pattern = '^%s*([av]f)%s+()%a*$', list = list_option_verb_list, append = ' ' },
|
||||||
{ pattern = '^%s*([av]f)%s+"()%a*$', list = list_option_verb_list, append = '" ' },
|
{ pattern = '^%s*([av]f)%s+"()%a*$', list = list_option_verb_list, append = '" ' },
|
||||||
{ pattern = '${=?()[%w_/-]+$', list = property_list, append = '}' },
|
{ pattern = '${=?()[%w_/-]*$', list = property_list, append = '}' },
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, command in pairs({'set', 'add', 'cycle', 'cycle[-_]values', 'multiply'}) do
|
for _, command in pairs({'set', 'add', 'cycle', 'cycle[-_]values', 'multiply'}) do
|
||||||
completers[#completers + 1] = {
|
completers[#completers + 1] = {
|
||||||
pattern = '^%s*' .. command .. '%s+()[%w_/-]+$',
|
pattern = '^%s*' .. command .. '%s+()[%w_/-]*$',
|
||||||
list = property_list,
|
list = property_list,
|
||||||
append = ' ',
|
append = ' ',
|
||||||
}
|
}
|
||||||
completers[#completers + 1] = {
|
completers[#completers + 1] = {
|
||||||
pattern = '^%s*' .. command .. '%s+"()[%w_/-]+$',
|
pattern = '^%s*' .. command .. '%s+"()[%w_/-]*$',
|
||||||
list = property_list,
|
list = property_list,
|
||||||
append = '" ',
|
append = '" ',
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user