zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: 'zle redisplay' bug in 5.3?
Date: Thu, 05 Jan 2017 15:01:35 +0000	[thread overview]
Message-ID: <20170105150135.75a490bb@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <170105010914.ZM1529@torch.brasslantern.com>

On Thu, 5 Jan 2017 01:09:14 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Jan 5,  4:01pm, Jan Larres wrote:
> }
> }   expand-or-complete-with-dots() {
> }       echo -ne "\e[31m......\e[0m"
> }       zle expand-or-complete
> }       zle redisplay
> }   }
> 
> Hmm.  Indeed, with multi-line prompts, invoking redisplay immediately
> after a completion menu is displayed will move the cursor upward as
> many extra lines as the prompt is tall but then does not finish the
> repainting of the prompt, leaving the cursor in the wrong place.
>
> You don't even need compinit, just do:
> 
>     % PS1=$':first line\n'"$PS1"
>     :first line
>     % ls <TAB>
>     :first line
>     % ls <M-x redisplay><RET>
> 
> and you'll observe zle get confused.
> 
> This is from workers/38048z ... where I asked for additional feedback
> and got none ... discussion starts in users/21315.
> 
> I suspect something is different about the complist module vs. plain
> completion menu and the change in 38048 does not account for the
> latter.

I don't know anything about this beyond the fact that showinglist has
three values: off, an extra special clever value (-1), and an extra extra
special very very clever value (-2), and no normal values (> 0) because
that wouldn't be clever enough.

The documentation says

/* Most lines of the buffer we've shown at once with the current list *
 * showing.  == 0 if there is no list.  == -1 if a new list has just  *
 * been put on the screen.  == -2 if zrefresh() needs to put up a new *
 * list.                                                              */

/**/
mod_export int showinglist;

Is it a case of the two requiring different handling?  You might have
thought the different behaviour was the one where the new list was
needed as in the other cases the screen is already in a consistent state
(perhaps?)  Something like the following?

pws

diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 8d173cd..49ce154 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -2434,8 +2434,13 @@ redisplay(UNUSED(char **args))
     moveto(0, 0);
     zputc(&zr_cr);		/* extra care */
     tc_upcurs(lprompth - 1);
-    resetneeded = !showinglist;
-    clearflag = showinglist;
+    if (showinglist == -2) {
+	resetneeded = 0;
+	clearflag = 1;
+    } else {
+	resetneeded = 1;
+	clearflag = 0;
+    }
     return 0;
 }
 


       reply	other threads:[~2017-01-05 15:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170105030137.v4tzweda6pxyqnrq@majutsushi.net>
     [not found] ` <CGME20170105091042epcas1p3ebc6c107d3121c8f6b980bbcbc59bc60@epcas1p3.samsung.com>
     [not found]   ` <170105010914.ZM1529@torch.brasslantern.com>
2017-01-05 15:01     ` Peter Stephenson [this message]
2017-01-05 17:08       ` Bart Schaefer
2017-01-07 18:05         ` Bart Schaefer
2017-01-07 18:53           ` Peter Stephenson
2017-01-07 20:04             ` Peter Stephenson
2017-01-08  4:46               ` Bart Schaefer
2017-01-08 17:59                 ` 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=20170105150135.75a490bb@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).