Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH 2/2: _tmux: Complete also for unambiguous prefixes
- X-seq: zsh-workers 30368
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH 2/2: _tmux: Complete also for unambiguous prefixes
- Date: Sat, 24 Mar 2012 11:18:17 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=/jS7vJufTeSzPiisYNwqne5UqSElA3xPLfHMvqsuWFM=; b=iondTMuPClm1wCoE5vjBasJmY2UaXxhpjX8CVtuDZxl9gHjPV22EfNAmx29koBKYqK BM4gM3x3zHurzV2+WPxdhdMU/yvKdDOx9w2+hFnKLREArU6+tST31ouZMCZKaFKjJ3BG HZSpYdT5FDNqePdZUA8FVhCMAUTlARyIgnrRN3yR7jl54dc1jHYZk2b22rxuWxJtq9bC GWbVtKQtiPIT7RNKHqNIkEhrl16vToQ3XvUpwPq2B+j3oURG/HtpL71U3jJmVURs2S/f hUywickLhMdP2EjesEM5ksSlkBfXQ+NlN560tzrCaKuZpPVtVzrKHJ6Emq51LntG/Tyo txyA==
- In-reply-to: <1332584297-26848-1-git-send-email-mikachu@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1332584297-26848-1-git-send-email-mikachu@gmail.com>
---
Completion/Unix/Command/_tmux | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux
index 3327b14..39befe8 100644
--- a/Completion/Unix/Command/_tmux
+++ b/Completion/Unix/Command/_tmux
@@ -1528,6 +1528,18 @@ function _tmux() {
if [[ -n ${_tmux_aliasmap[$tmuxcommand]} ]] ; then
tmuxcommand="${_tmux_aliasmap[$tmuxcommand]}"
fi
+ if ! (( ${+functions[_tmux-$tmuxcommand]} )); then
+ local low high
+ low=$_tmux_commands[(i)$tmuxcommand*]
+ high=$_tmux_commands[(I)$tmuxcommand*]
+ if (( low == high )); then
+ tmuxcommand=${_tmux_commands[low]%%:*}
+ elif (( low < high )); then
+ _message -e "Ambiguous command $tmuxcommand"
+ else
+ _message -e "Subcommand $tmuxcommand not known"
+ fi
+ fi
curcontext="${curcontext%:*:*}:tmux-${tmuxcommand}:"
_call_function ret _tmux-${tmuxcommand}
fi
--
1.7.10-rc2
Messages sorted by:
Reverse Date,
Date,
Thread,
Author