From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5586 invoked by alias); 12 Aug 2010 20:20:53 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28161 Received: (qmail 1371 invoked from network); 12 Aug 2010 20:20:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lcqPtfnIvU+Y/J9vA7b28qCgRvQ8ZXCt8DHJUbtCFFQ=; b=cfhdqD1H0M2tPp751M+IUvGiA2OutO4UCIfpfdRwgV4U5vKCzytq3Bu5jSHcPqMm0s QJNzF1J0l74hUaqP8ZlsfZFbL0XMpj3I1RzlyCs3F6Z2k6wZRsSDLEDwFHtnmaSEJfvQ g1Ceo3M4RplKsBu4b/uPCgFtO5gaAcJnWfa/4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fx9I58ct6KuGSEtm2wT0yEHhdMSUvb2DwavsoCwJdso0Wvo0Wjsj8UNEGWuoMcy9V3 wEvKSZo2lQ7+Oq6nFc6lC5gb8UqmROR0BuL1Pq9wNuCMiGzRXQBe98d1erzC9sz2FvC5 0y7yWvWYjrv/5SY2Fj8ZIKomFR/HzSNGPnXQM= MIME-Version: 1.0 In-Reply-To: <20100812205613.6d09af17@pws-pc> References: <20100812205613.6d09af17@pws-pc> Date: Thu, 12 Aug 2010 22:14:36 +0200 Message-ID: Subject: Re: Oddity with reset-prompt and vared From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12 August 2010 21:56, Peter Stephenson wro= te: > On Tue, 3 Aug 2010 22:30:32 +0200 > Mikael Magnusson wrote: >> % zsh -f >> % function a() { zle reset-prompt; zle .accept-line } >> % zle -N accept-line a >> % a=3D >> % vared a >> aoeua >> % vared a >> =E3=81=A1=E3=81=A8=E3=81=97=E3=81=AF=E3=81=8D >> > > This is a quite general (if rather boring) problem, I'm not sure why it > hasn't shown up before. > > Second hunk isn't related but looks sensible. > > Index: Src/Zle/zle_refresh.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v > retrieving revision 1.79 > diff -p -u -r1.79 zle_refresh.c > --- Src/Zle/zle_refresh.c 2 Aug 2010 09:02:30 -0000 1.79 > +++ Src/Zle/zle_refresh.c 12 Aug 2010 19:54:48 -0000 > @@ -1789,7 +1789,7 @@ refreshline(int ln) > /* 0: setup */ > nl =3D nbuf[ln]; > rnllen =3D nllen =3D nl ? ZR_strlen(nl) : 0; > - if (obuf[ln]) { > + if (ln < olnct && obuf[ln]) { > ol =3D obuf[ln]; > ollen =3D ZR_strlen(ol); > } > @@ -2083,7 +2083,12 @@ refreshline(int ln) > if (now_off) > settextattributes(TXT_ATTR_OFF_FROM_ON(now_off)); > > +#ifdef MULTIBYTE_SUPPORT > + if (nl->chr !=3D WEOF) > + zputc(nl); > +#else > zputc(nl); > +#endif > nl++, ol++; > ccs++, vcs++; > #ifdef MULTIBYTE_SUPPORT Hm, maybe this is also the source of my mysterious problem of text sometimes disappearing from the command line very rarely. I'll keep an eye out for if that still happens. (I may not have reported it as I was never able to reproduce it). --=20 Mikael Magnusson