From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] _bindkey: Fix first argument completion.
Date: Tue, 16 Dec 2014 01:37:23 +0000 [thread overview]
Message-ID: <20141216013723.GB2138@tarsus.local2> (raw)
[-- Attachment #1: Type: text/plain, Size: 1014 bytes --]
Before this commit, 'bindkey -<TAB>' would offer screenfuls of widgets, rather
than just the options. That was caused by the 'r:|-=* r:|=*' matcher being
applied, which considered the "-" a possible positional argument.
Fix the problem by informing _arguments that the first positional argument can
never be a widget.
---
Completion/Zsh/Command/_bindkey | 1 +
1 file changed, 1 insertion(+)
diff --git a/Completion/Zsh/Command/_bindkey b/Completion/Zsh/Command/_bindkey
index 045cba9..4c4aeda 100644
--- a/Completion/Zsh/Command/_bindkey
+++ b/Completion/Zsh/Command/_bindkey
@@ -26,6 +26,7 @@ _arguments -C -s -S \
'(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \
'(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \
'(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \
+ '(-l -L -d -A -N -m -p -r -s):in-string' \
'(-l -L -d -A -N -m -p -r -s)*::widgets:->widget' && ret=0
case $state in
--
1.7.10.4
[-- Attachment #2: 0001-_bindkey-Fix-first-argument-completion.patch --]
[-- Type: text/x-patch, Size: 1228 bytes --]
>From f7aafab1fbeba95ad601fb67d0ae40d7f8cba6ce Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
Date: Mon, 15 Dec 2014 17:31:35 +0000
Subject: [PATCH] _bindkey: Fix first argument completion.
Before this commit, 'bindkey -<TAB>' would offer screenfuls of widgets, rather
than just the options. That was caused by the 'r:|-=* r:|=*' matcher being
applied, which considered the "-" a possible positional argument.
Fix the problem by informing _arguments that the first positional argument can
never be a widget.
---
Completion/Zsh/Command/_bindkey | 1 +
1 file changed, 1 insertion(+)
diff --git a/Completion/Zsh/Command/_bindkey b/Completion/Zsh/Command/_bindkey
index 045cba9..4c4aeda 100644
--- a/Completion/Zsh/Command/_bindkey
+++ b/Completion/Zsh/Command/_bindkey
@@ -26,6 +26,7 @@ _arguments -C -s -S \
'(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \
'(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \
'(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \
+ '(-l -L -d -A -N -m -p -r -s):in-string' \
'(-l -L -d -A -N -m -p -r -s)*::widgets:->widget' && ret=0
case $state in
--
1.7.10.4
reply other threads:[~2014-12-16 1:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141216013723.GB2138@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).