From ce0452fa0dea75c8909270c62225fcfc44541fe1 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sun, 29 Sep 2024 22:14:19 +0200 Subject: [PATCH] zsh-completion: fix completing --screenshot-avif-opts-* The list options --screenshot-avif-opts and --vo-image-opts are completed with an extra 8), e.g. --screenshot-avif-opts-add=8), because *= in screenshot-avif-opts=-:Key/value list (default\: usage=allintra,crf=0,cpu-used=8): matches up to cpu-used= instead of instead of up to screenshot-avif-opts=. Fix this by enabling non-greedy matching. --- etc/_mpv.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/_mpv.zsh b/etc/_mpv.zsh index 64795ddb23..2e4fec408b 100644 --- a/etc/_mpv.zsh +++ b/etc/_mpv.zsh @@ -65,7 +65,7 @@ function _mpv_generate_arguments { _mpv_completion_arguments+="$name" else # Find the parent option and use that with this option's name - _mpv_completion_arguments+="${_mpv_completion_arguments[(R)${name%-*}=*]/*=/$name=}" + _mpv_completion_arguments+="${(S)_mpv_completion_arguments[(R)${name%-*}=*]/*=/$name=}" fi elif [[ $desc == Print* ]]; then