zsh-workers
 help / color / mirror / code / Atom feed
From: P.Stephenson@swansea.ac.uk
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: Small display bug
Date: Thu, 06 Jul 95 16:11:49 +0100	[thread overview]
Message-ID: <21468.9507061511@pyro.swan.ac.uk> (raw)
In-Reply-To: "heading_anthony@jpmorgan.com"'s message of "04 Jul 95 17:12:00 +0800." <n1407262512.47679@smtpgwprod.ny.jpmorgan.com>

heading_anthony@jpmorgan.com wrote:
> 
> A little display problem I've encountered:
> 
> Let _ be the cursor
> 
> % bindkey -e_
> 
> Then hit <esc>-t to transpose words
> 
> % -e bindkey_ -e

The problem is that refreshline() is clever enough to insert a new '-e
' before the bindkey, but doesn't hang around long enough to delete
the final -e.  I think I've seen similar behaviour a number of times,
but this is the first reproducible one.

This fixes it by
1) if it's possible to clear to end of line, do so if the old line
hasn't been used up when the new line is done (this should fix your
problem)
2) otherwise, output some extra spaces (this may be overkill since 1)
should cover most times there's a problem).

Very likely this depends on Zefram's recent zle patches.

*** Src/zle_refresh.c.ceol	Wed Jul  5 14:27:13 1995
--- Src/zle_refresh.c	Thu Jul  6 15:59:29 1995
***************
*** 486,491 ****
--- 486,493 ----
  	if ((j > i + tclen[TCCLEAREOL]) || /* new buf's spaces early enough */
  	    (nllen == winw && nl[winw - 1] == ' '))
  	    col_cleareol = i;
+ 	else
+ 	    col_cleareol = nllen;
      }
  
  /* 3: set character for first column, in case automargin stuff needs doing */
***************
*** 497,503 ****
      /* skip past all matching characters */
  	for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
  
! 	if (!*nl)		/* we've finished writing the new line */
  	    return;
  
  	moveto(ln, ccs);	/* move to where we do all output from */
--- 499,505 ----
      /* skip past all matching characters */
  	for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
  
! 	if (!*nl && !*ol)	/* we've finished writing the new line */
  	    return;
  
  	moveto(ln, ccs);	/* move to where we do all output from */
***************
*** 506,511 ****
--- 508,522 ----
  	if ((col_cleareol != -1) && (ccs >= col_cleareol)) {
  	    tcout(TCCLEAREOL);
  	    SELECT_ADD_COST(tclen[TCCLEAREOL]);
+ 	    return;
+ 	}
+     /* otherwise, if we've finished the new buffer, dump out enough spaces */
+ 	if (!*nl) {
+ 	    j = strlen(ol);
+ 	    for (i = 0; i < j; i++)
+ 		putc(' ', shout);
+ 	    vcs += j;
+ 	    moveto(ln, ccs);
  	    return;
  	}
  

-- 
Peter Stephenson <P.Stephenson@swansea.ac.uk>  Tel: +44 1792 205678 extn. 4461
WWW:  http://python.swan.ac.uk/~pypeters/      Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.


  parent reply	other threads:[~1995-07-06 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-07-04 17:12 Heading, Anthony
1995-07-04 16:42 ` Some other Small display bugs Peter Kutschera
1995-07-06 15:11 ` P.Stephenson [this message]
1995-07-06 16:09   ` Small display bug P.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=21468.9507061511@pyro.swan.ac.uk \
    --to=p.stephenson@swansea.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /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).