Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: File completion with **/ (with solution)
- X-seq: zsh-users 21955
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: File completion with **/ (with solution)
- Date: Wed, 21 Sep 2016 13:30:51 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=bUsy4UnraSG238Qx0PIiBnWXB3eiJYxcEo2lIgLzAz0=; b=BDLEVOZjKcH5nde4uBI4OoPE+XW394aNyOD8rDcr8IqEr9FVwpLffFRfzKdWMQocPN S4Vtw/l+R3yAWcL8sFeSSe1muw228Lsvi1aRoasI1AIFS9y8E1TirIRDH69bs2zOls9j e2/HHkwYXeeaORd0hPij/+AsAQfA9/mF/RkGOYDfHfaCiKD2QgQPgvJm1OeiyazrzoOp UbAwRHel0ubeoa1rPpjBugBhiV5ziBPF002Gd17omhVSOCdrHzwEUzR6gHBzFjg+qGvT 9AGYcg6XJ6AtPzwipHZluPxBtjU2/u9O29uDJCDNi/pcqU8FLKiEVXFZgYM2/+XOQ6yv UdoQ==
- In-reply-to: <160920223246.ZM862@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <160920175623.ZM32730@torch.brasslantern.com> <160920223246.ZM862@torch.brasslantern.com>
On Sep 20, 10:32pm, Bart Schaefer wrote:
}
} There's a typo above; should be
} zstyle :completion::user-expand::: tag-order expansions all-expansions
}
} I'm not sure why there are fewer colons in user-expand than in tag-order.
} I think there's a similar typo in _user_expand looking up that style.
There's an additional bug in _user_expand that breaks tag-order when
there is exactly a single match. I think the -gt test (see diff) was
expecting $exp[1] to be the original input pattern and wanted to skip
that, or something.
I'll apply the patch below to make the above tag-order work in zsh 5.3,
but for all prior versions you'll have to do:
zstyle :completion::user-expand::: tag-order 'expansions all-expansions'
diff --git a/Completion/Base/Completer/_user_expand b/Completion/Base/Completer/_user_expand
index cf3d172..066e2e8 100644
--- a/Completion/Base/Completer/_user_expand
+++ b/Completion/Base/Completer/_user_expand
@@ -27,7 +27,7 @@ exp=("$word")
# Now look for user completions.
-zstyle -a ":completion:${curcontext}" user-expand specs || return 1
+zstyle -a ":completion:${curcontext}:" user-expand specs || return 1
for spec in $specs; do
REPLY=
@@ -95,7 +95,7 @@ if [[ -z "$compstate[insert]" ]] ;then
else
_tags all-expansions expansions original
- if [[ $#exp -gt 1 ]] && _requested expansions; then
+ if [[ $#exp -ge 1 ]] && _requested expansions; then
local i j normal space dir
if [[ "$sort" = menu ]]; then
Messages sorted by:
Reverse Date,
Date,
Thread,
Author