Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Small display bug
- X-seq: zsh-workers 160
- From: P.Stephenson@xxxxxxxxxxxxx
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: Small display bug
- Date: Thu, 06 Jul 95 17:09:45 +0100
- In-reply-to: "P.Stephenson@xxxxxxxxxxxxx"'s message of "Thu, 06 Jul 95 16:11:49 BST." <21468.9507061511@xxxxxxxxxxxxxxx>
I wrote:
> > % bindkey -e_
> >
> > Then hit <esc>-t to transpose words
> >
> > % -e bindkey_ -e
>
> This fixes it...
except I forgot to check lines which wraparound the screen... this
version with a couple of extra tests now works O.K. with that.
I'd much prefer a zle_refresh expert to fix this but that department's
been quiet for a while, perhaps they're having to work or something.
There is still a bug when you insert in the middle of a long line over
the line break, but I don't think I've caused that --- at least, to
the best of my knowledge it's the same both before and after this
patch.
Guess who I replied to before I remembered to change it...
*** Src/zle_refresh.c.ceol Wed Jul 5 14:27:13 1995
--- Src/zle_refresh.c Thu Jul 6 17:04:01 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 if (nllen < winw)
+ col_cleareol = nllen;
}
/* 3: set character for first column, in case automargin stuff needs doing */
***************
*** 497,504 ****
/* 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,506 ----
/* skip past all matching characters */
for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
! if ((!*nl && !*ol) || ccs >= winw)
! return; /* we've finished writing the new line */
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@xxxxxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author