From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Oddity with reset-prompt and vared
Date: Thu, 12 Aug 2010 20:56:13 +0100 [thread overview]
Message-ID: <20100812205613.6d09af17@pws-pc> (raw)
In-Reply-To: <AANLkTimRzdPOSNwXOhDxWxVA0GRSfUO5vFu8F+JPW4pt@mail.gmail.com>
On Tue, 3 Aug 2010 22:30:32 +0200
Mikael Magnusson <mikachu@gmail.com> wrote:
> % zsh -f
> % function a() { zle reset-prompt; zle .accept-line }
> % zle -N accept-line a
> % a=
> % vared a
> aoeua
> % vared a
> ちとしはき<press enter>
> <the end of the string is replaced with spaces>
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
===================================================================
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 = nbuf[ln];
rnllen = nllen = nl ? ZR_strlen(nl) : 0;
- if (obuf[ln]) {
+ if (ln < olnct && obuf[ln]) {
ol = obuf[ln];
ollen = 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 != WEOF)
+ zputc(nl);
+#else
zputc(nl);
+#endif
nl++, ol++;
ccs++, vcs++;
#ifdef MULTIBYTE_SUPPORT
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
next prev parent reply other threads:[~2010-08-12 19:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 20:30 Mikael Magnusson
2010-08-12 19:56 ` Peter Stephenson [this message]
2010-08-12 20:14 ` Mikael Magnusson
2010-08-13 8:48 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100812205613.6d09af17@pws-pc \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).