Closed guidocella closed 1 day ago
Download the artifacts for this pull request:
The printed lines don't being with spaces because otherwise they are added to the completions by etc/_mpv.zsh.
This can be fixed by printing the GPU API names first instead of context names, right? This is the current behavior of --gpu-api=help
. I think this is a bad reason to remove spaces just because some outside scripts can't handle it.
With the APIs first they get completed twice and the last contexts are interpreted as descriptions:
mpv --gpu-api=<Tab>
auto -- auto
opengl -- drm
vulkan -- displayvk
auto opengl vulkan
Actually completing them works though so it's acceptable.
It's a bit less nice than --gpu-context
since using completing --gpu-api
here automatically adds a space after the completion. But this is better than the current status quo of "doesn't complete at all" so I'm fine with it if you don't want to investigate further.
A space is added after completions with only 1 result, --gpu-api
doesn't do anything different.
Ah my bad. I was typing wayland and foolishly thought that was a full completion.
This follows up 96e1f1dfa5 which converted --gpu-context, and has the same advantages as listed there.
Unlike with --gpu-context auto can be used anywhere in the list, e.g. --gpu-api=d3d11,auto works.
I wanted to use the list of GPU contexts as the description in get_type_desc(), but there is no talloc context to allocate it to, so I set a print_help_list to print them. The printed lines don't being with spaces because otherwise they are added to the completions by etc/_mpv.zsh.