From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7916 invoked by alias); 24 Mar 2012 10:26:09 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30368 Received: (qmail 13757 invoked from network); 24 Mar 2012 10:26:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.171 as permitted sender) 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== From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH 2/2: _tmux: Complete also for unambiguous prefixes Date: Sat, 24 Mar 2012 11:18:17 +0100 Message-Id: <1332584297-26848-2-git-send-email-mikachu@gmail.com> X-Mailer: git-send-email 1.7.10-rc2 In-Reply-To: <1332584297-26848-1-git-send-email-mikachu@gmail.com> 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