From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5380 invoked from network); 25 May 2001 15:13:24 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 May 2001 15:13:24 -0000 Received: (qmail 28392 invoked by alias); 25 May 2001 15:13:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14481 Received: (qmail 28378 invoked from network); 25 May 2001 15:13:14 -0000 From: "Bart Schaefer" Message-Id: <1010525151112.ZM14441@candle.brasslantern.com> Date: Fri, 25 May 2001 15:11:11 +0000 In-Reply-To: Comments: In reply to Cesar Crusius "compctl -y problem." (May 24, 11:44am) References: X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: compctl -y problem. Cc: Cesar Crusius MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 24, 11:44am, Cesar Crusius wrote: } Subject: compctl -y problem. } } compctl -K project_changes -y '$change_descriptions' aecd } } When I press after aecd, the table shows as expected, but the } cursor does not return to where it should. It goes to one line below } where I originally typed . I mocked up a test case for this and there seems to be something pretty badly wrong with the -y option. Here's the test case: text80 () { local x='' repeat 8 x=1234567890$x text=$x$'\n'$text reply=($((++count))x80 $last) last=($reply) } text70 () { local x='' repeat 7 x=1234567890$x text=$x$'\n'$text reply=($((++count))x80 $last) last=($reply) } array () { local x='' repeat 8 x=1234567890$x text=($x $text) reply=($((++count))x80 $last) last=($reply) } compctl -K text80 -y '$text' try80 compctl -K text70 -y '$text' try70 compctl -K array -y '$text' tryA Before each test, initialze the globals: count=0 text='' last=() My results were as follows: Completion after `try80' puts the cursor N-1 lines ABOVE the correct line, where N is the number of lines in $text. Completion after `try70' puts the cursor N-1 lines BELOW the correct line. Completion after `tryA' puts the shell into an infinite loop; it has to be killed with `kill -9' from another terminal. I know Sven won't be thrilled about being asked to fix anything in the old compctl code ... perhaps we should just remove the `-y' option, as it's new since 3.0 anyway, and document the correct way to achieve the same effect by using the new completion system (which, incidentally, I don't know how to do ... `compadd -d' doesn't quite cut it). -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net