From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26875 invoked from network); 9 Jan 2001 08:02:39 -0000 Received: from sunsite.dk (HELO sunsite.auc.dk) (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Jan 2001 08:02:39 -0000 Received: (qmail 11126 invoked by alias); 9 Jan 2001 08:02:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13333 Received: (qmail 11119 invoked from network); 9 Jan 2001 08:02:31 -0000 Date: Tue, 9 Jan 2001 09:02:29 +0100 (MET) Message-Id: <200101090802.JAA10875@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Felix Rosencrantz's message of Sat, 30 Dec 2000 14:58:58 -0800 (PST) Subject: Re: Bug w/matching control + feature request Felix Rosencrantz wrote: > I'm seeing a problem with matching control and cursor placement. I suspect > the problem might be related to too many match points... > > Here's the case: > > zsh@ zsh -f > host% echo $ZSH_VERSION > 3.1.9-dev-8 > host% autoload -U compinit ; compinit -D ; compdef _tst tst > host% _tst () { > function> compadd -M 'r:|[.,_-]=** r:[^0-9]||[0-9]=**' glibc-2.1.94-3.i386.rpm > glibc-devel-2.1.94-3.i386.rpm glibc-profile-2.1.94-3.i386.rpm > function> } > host% tst glibc-2.1 > results in: > host% tst glibc-2[.]1.94-3.i386.rpm > > With the cursor sitting on the dot after the 2, rather than before the 2, > which seems like the place it would end up. Just to let everyone know: I'm working on this. The fix for the cursor positioning isn't all that difficult, but I know about two other test cases with wrong behaviour and want to send a patch for all things together. And since I'm still extremely busy... > Hmm... Since the matching specs and cursor positioning came up again, > it got me thinking about a feature request I've wanted. There are times > when matching places the cursor at the undesired spot for finishing the > completion of the word I'm completing. The matching code has an idea of > where several other reasonable cursor positions are (see the code > at zsh/Src/Zle/compresult.c:415, which picks from several possible > cursor locations as hot spots, there are probably a few more.) > > It seems like there would need to be a global array that is accessible to the > completion functions, that would hold valid hot spots in the current word. > It would then be possible to write a widget that would cycle the cursor > between these spots. I admit that I never thought of that. Sounds very sensible, and not even too hard to implement. But I don't want to promise anything at the moment... Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de