zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Oddity with reset-prompt and vared
Date: Thu, 12 Aug 2010 22:14:36 +0200	[thread overview]
Message-ID: <AANLkTikrfNbsaBLXMcuGOfUQE4AG=LaThifmnyLiVspO@mail.gmail.com> (raw)
In-Reply-To: <20100812205613.6d09af17@pws-pc>

On 12 August 2010 21:56, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> 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

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).

-- 
Mikael Magnusson


  reply	other threads:[~2010-08-12 20:20 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
2010-08-12 20:14   ` Mikael Magnusson [this message]
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='AANLkTikrfNbsaBLXMcuGOfUQE4AG=LaThifmnyLiVspO@mail.gmail.com' \
    --to=mikachu@gmail.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).