From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21324 invoked from network); 25 Oct 2005 23:12:14 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Oct 2005 23:12:14 -0000 Received: (qmail 78464 invoked from network); 25 Oct 2005 23:12:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Oct 2005 23:12:07 -0000 Received: (qmail 1463 invoked by alias); 25 Oct 2005 23:12:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21936 Received: (qmail 1374 invoked from network); 25 Oct 2005 23:12:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Oct 2005 23:12:03 -0000 Received: (qmail 77679 invoked from network); 25 Oct 2005 23:12:02 -0000 Received: from mta08-winn.ispmail.ntl.com (81.103.221.48) by a.mx.sunsite.dk with SMTP; 25 Oct 2005 23:11:59 -0000 Received: from aamta12-winn.ispmail.ntl.com ([81.103.221.35]) by mta08-winn.ispmail.ntl.com with ESMTP id <20051025231159.XFPF17804.mta08-winn.ispmail.ntl.com@aamta12-winn.ispmail.ntl.com>; Wed, 26 Oct 2005 00:11:59 +0100 Received: from pwslaptop.csr.com ([81.105.238.64]) by aamta12-winn.ispmail.ntl.com with SMTP id <20051025231158.UASX10626.aamta12-winn.ispmail.ntl.com@pwslaptop.csr.com>; Wed, 26 Oct 2005 00:11:58 +0100 Date: Wed, 26 Oct 2005 00:11:54 +0100 From: Peter Stephenson To: Mikael Magnusson Cc: pws@csr.com, zsh-workers@sunsite.dk Subject: Re: PATCH: displaying wide characters Message-Id: <20051026001154.32458ec3.p.w.stephenson@ntlworld.com> In-Reply-To: <237967ef0510240140g548e0c0r3deb3f4704dc313@mail.gmail.com> References: <200510192031.j9JKVYk7010115@pwslaptop.csr.com> <200510192041.j9JKfTJZ010450@pwslaptop.csr.com> <237967ef0510191739t103352a9vad735334a790d8b5@mail.gmail.com> <237967ef0510240140g548e0c0r3deb3f4704dc313@mail.gmail.com> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Mon, 24 Oct 2005 10:40:42 +0200 Mikael Magnusson wrote: > Found one issue with editing wide characters on the command line, > input some doublewidth characters, erase one near the left end, then > go to the right and erase another. The second time the cursor will > only move one character to the left instead of two and cursor display > will not correspond with reality anymore. For some reason it only > seems to happen with 6 characters or more, the ones i'm using are > hiragana. I think the following patch fixes this issue, at least what I was seeing. I'm quite sure there are plenty of other oddities like this. I also think that, while you can now type a line of double-width characters that wraps without the display going, there are likely to be problems when you edit the part of the line before the wrap. Index: Src/Zle/zle_refresh.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v retrieving revision 1.33 diff -u -r1.33 zle_refresh.c --- Src/Zle/zle_refresh.c 24 Oct 2005 16:58:43 -0000 1.33 +++ Src/Zle/zle_refresh.c 25 Oct 2005 23:09:09 -0000 @@ -1138,6 +1138,12 @@ tc_delchars(i); ol += i; char_ins -= i; +#ifdef ZLE_UNICODE_SUPPORT + while (*ol == WEOF) { + ol++; + char_ins--; + } +#endif i = 0; break; } -- Peter Stephenson Web page still at http://www.pwstephenson.fsnet.co.uk/