From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2496 invoked from network); 14 Aug 2001 11:55:53 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Aug 2001 11:55:53 -0000 Received: (qmail 12099 invoked by alias); 14 Aug 2001 11:55:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15621 Received: (qmail 12074 invoked from network); 14 Aug 2001 11:55:41 -0000 Date: Tue, 14 Aug 2001 21:55:37 +1000 From: Geoff Wing To: Zsh Hackers Subject: PATCH: Status line fixes (Was: Various vared problems with screen refresh, etc.) Message-ID: <20010814215537.A2327@primenet.com.au> References: <1010814073010.ZM7551@candle.brasslantern.com>; <20010814182828.A22134@primenet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010814182828.A22134@primenet.com.au>; from gcw@zsh.org on Tue, Aug 14, 2001 at 08:28:44AM +0000 Organization: PrimeNet Computer Consultancy Geoff Wing typed: :Bart Schaefer typed: ::First problem: Display refresh when a "minibuffer" command is used. ::Make sure the cursor is at the last line (do end-of-buffer-or-history). ::Invoke history-incremental-search-backward or -forward and look closely ::at the display. In my case, I'm seeing some lines that should be off ::the top of the screen appearing above the `bck-i-search:' prompt. I ::think a refresh computation somewhere is counting down N lines from the ::first line in the whole buffer, rather than down N lines from the first ::visible line. :My problem. I'll provide a patch for it. It's duplicating a scroll :around zle_refresh.c:436+ and snextline define. Patch for three display things: 1) status line display was being mucked up 2) continuation marker "<...." for line extension off bottom right wasn't working properly 3) status line continuation marker "<....>" at end of first status line wasn't working properly This slightly overloads "snextline" define in that one case should only exist at the first usage however it's slightly tidier to do it this way instead of making sure mostly duplicate code is synchronised. Index: Src/Zle/zle_refresh.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v retrieving revision 1.1.1.19 diff -u -r1.1.1.19 zle_refresh.c --- Src/Zle/zle_refresh.c 2000/03/25 00:22:06 1.1.1.19 +++ Src/Zle/zle_refresh.c 2001/08/14 11:45:09 @@ -223,16 +223,25 @@ if (ln != winh - 1) \ ln++; \ else \ - if (tosln < 3) { \ + if (tosln > ln) { \ + tosln--; \ + if (nvln > 1) { \ + scrollwindow(0); \ + nvln--; \ + } else \ + more_end = 1; \ + } else if (tosln > 2 && nvln > 1) { \ + tosln--; \ + if (tosln <= nvln) { \ + scrollwindow(0); \ + nvln--; \ + } else { \ + scrollwindow(tosln); \ + more_end = 1; \ + } \ + } else { \ more_status = 1; \ scrollwindow(tosln + 1); \ - } else if (tosln - 1 <= nvln) { \ - scrollwindow(0); \ - if (nvln) \ - nvln--, tosln--; \ - } else { \ - tosln--; \ - scrollwindow(tosln); \ } \ if (!nbuf[ln]) \ nbuf[ln] = (char *)zalloc(winw + 2); \ @@ -435,13 +444,6 @@ if (statusline) { tosln = ln + 1; - if (ln == winh - 1) { - if (nvln > 0) { - scrollwindow(0); - nvln--; - } - tosln--; - } nbuf[ln][winw + 1] = '\0'; /* text not wrapped */ snextline t = (unsigned char *)statusline; @@ -460,23 +462,43 @@ snextline } } + if (s == sen) + snextline } + *s = '\0'; /* insert <.... at end of last line if there is more text past end of screen */ if (more_end) { if (!statusline) tosln = winh; - strncpy(nbuf[tosln - 1] + winw - 7, " <.... ", 7); + s = nbuf[tosln - 1]; + sen = s + winw - 7; + for (; s < sen; s++) { + if (*s == '\0') { + for (; s < sen; ) + *s++ = ' '; + break; + } + } + strncpy(sen, " <.... ", 7); nbuf[tosln - 1][winw] = nbuf[tosln - 1][winw + 1] = '\0'; } /* insert <....> at end of first status line if status is too big */ if (more_status) { - strncpy(nbuf[tosln] + winw - 8, " <....> ", 8); + s = nbuf[tosln]; + sen = s + winw - 8; + for (; s < sen; s++) { + if (*s == '\0') { + for (; s < sen; ) + *s++ = ' '; + break; + } + } + strncpy(sen, " <....> ", 8); nbuf[tosln][winw] = nbuf[tosln][winw + 1] = '\0'; } - *s = '\0'; nlnct = ln + 1; for (ln = nlnct; ln < winh; ln++) zfree(nbuf[ln], winw + 2), nbuf[ln] = NULL; -- Geoff Wing : Rxvt Stuff : Zsh Stuff :