From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8035 invoked from network); 10 Nov 2007 18:55:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Nov 2007 18:55:19 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 91225 invoked from network); 10 Nov 2007 18:55:09 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Nov 2007 18:55:08 -0000 Received: (qmail 15638 invoked by alias); 10 Nov 2007 18:55:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24082 Received: (qmail 15583 invoked from network); 10 Nov 2007 18:55:01 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 10 Nov 2007 18:55:01 -0000 Received: (qmail 90645 invoked from network); 10 Nov 2007 18:55:01 -0000 Received: from mtaout02-winn.ispmail.ntl.com (81.103.221.48) by a.mx.sunsite.dk with SMTP; 10 Nov 2007 18:54:53 -0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20071110185449.NFLS25022.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sat, 10 Nov 2007 18:54:49 +0000 Received: from pws-pc.ntlworld.com ([81.107.45.67]) by aamtaout01-winn.ispmail.ntl.com with SMTP id <20071110185449.OSH219.aamtaout01-winn.ispmail.ntl.com@pws-pc.ntlworld.com> for ; Sat, 10 Nov 2007 18:54:49 +0000 Date: Sat, 10 Nov 2007 18:54:42 +0000 From: Peter Stephenson To: zsh-workers Subject: Re: some more problems with delete-whole-word-match, no patch Message-Id: <20071110185442.6969a728.p.w.stephenson@ntlworld.com> In-Reply-To: <237967ef0711090756l453c1e07l620faf91e143dac6@mail.gmail.com> References: <237967ef0711090756l453c1e07l620faf91e143dac6@mail.gmail.com> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 9 Nov 2007 16:56:56 +0100 "Mikael Magnusson" wrote: > 1) > if you have two or more spaces between two words and position the > cursor between them, invoking the widget will insert an extra space. > 2) > if you position the cursor at the end of the word, the widget leaves > the last character of the word intact, if there is a trailing space > (as there usually is if the word isn't the last word on the command > line). (You mean with the cursor on the whitespace itself.) > Putting in a [[ $pos1 = $pos2 ]] && return seems to fix the first > problem but I figured the problems are probably related somehow, and > I'm not sure why the second occurs. You're right, it's the same bug. If there's whitespace at the cursor position it gets the end position one too short. Index: Functions/Zle/delete-whole-word-match =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Zle/delete-whole-word-match,v retrieving revision 1.5 diff -u -r1.5 delete-whole-word-match --- Functions/Zle/delete-whole-word-match 10 Nov 2007 17:37:55 -0000 1.5 +++ Functions/Zle/delete-whole-word-match 10 Nov 2007 18:52:58 -0000 @@ -31,7 +31,7 @@ if [[ -n "${matched_words[4]}" ]]; then # There's whitespace at the cursor position, so only delete # up to the cursor position. - pos2=$CURSOR + (( pos2 = CURSOR + 1 )) else # No whitespace at the cursor position, so delete the # current character and any following wordcharacters. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/