From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29916 invoked from network); 9 Jul 2003 15:51:32 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Jul 2003 15:51:32 -0000 Received: (qmail 28095 invoked by alias); 9 Jul 2003 15:51:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18841 Received: (qmail 28085 invoked from network); 9 Jul 2003 15:51:27 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 9 Jul 2003 15:51:27 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 9 Jul 2003 15:51:27 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-19.tower-1.messagelabs.com!1057765233!127830 X-StarScan-Version: 5.0.7; banners=.,-,- Received: (qmail 29109 invoked from network); 9 Jul 2003 15:40:33 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-19.tower-1.messagelabs.com with SMTP; 9 Jul 2003 15:40:33 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h69FeWHg013138 for ; Wed, 9 Jul 2003 16:40:32 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h69FfcH21513 for ; Wed, 9 Jul 2003 17:41:38 +0200 X-VirusChecked: Checked From: Oliver Kiddle To: Zsh workers Subject: PATCH: _prefix clearing the word Date: Wed, 09 Jul 2003 17:41:38 +0200 Message-ID: <21511.1057765298@gmcs3.local> zstyle ':completion:*' completer _complete _prefix cd /usr/looc and the whole word disappears. This problem relates back to the change in 15357. That change was a fairly nasty hack: to prevent the cursor going to the end of the suffix if there is one match a second match is added which is the same as the first (${compstate[unambiguous]}) with the suffix chopped off and an `x' added. This results in an ambiguous completion so the cursor doesn't advance past the suffix. Now in this particular case, it gets an ambiguous completion where the common part is nothing. I have no idea why but it probably has something to do with the first match being added with some special case stuff (compadd -Qf -p /usr/ -W /usr/). Best I can think of is the patch below. If adding the second match results in ${compstate[unambiguous]} being empty then insert the first match. Seems to work quite well but I wouldn't be suprised if we need to patch more things onto the side of this. By the way, the bug mentioned in 17846 is still an issue. Not really related to _prefix but it was through that that I was reminded. Oliver Index: Completion/Base/Completer/_prefix =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_prefix,v retrieving revision 1.2 diff -u -r1.2 _prefix --- Completion/Base/Completer/_prefix 10 Jul 2001 09:25:43 -0000 1.2 +++ Completion/Base/Completer/_prefix 9 Jul 2003 15:23:59 -0000 @@ -48,7 +48,11 @@ [[ compstate[nmatches] -gt 1 ]] && return 0 compadd -U -i "$IPREFIX" -I "$ISUFFIX" - "${compstate[unambiguous]%$suf}x" compstate[list]= - compstate[insert]=unambiguous + if [[ -n $compstate[unambiguous] ]]; then + compstate[insert]=unambiguous + else + compstate[insert]=0 + fi return 0 fi (( _matcher_num++ )) ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________