From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id QAA02860 for ; Tue, 30 Jul 1996 16:34:35 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id CAA06713; Tue, 30 Jul 1996 02:25:57 -0400 (EDT) Resent-Date: Tue, 30 Jul 1996 02:25:57 -0400 (EDT) From: Geoff Wing Message-Id: <199607300620.QAA02760@coral.primenet.com.au> Subject: zle_refresh.c patch (Was: New zed and refresh bug) To: zsh-workers@math.gatech.edu Date: Tue, 30 Jul 1996 16:20:17 +1000 (EST) Cc: hzoli@cs.elte.hu (Zoltan Hidvegi) In-Reply-To: <199607300452.OAA02241@coral.primenet.com.au> from "Geoff Wing" at Jul 30, 96 02:52:11 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"HpFL5.0.pe1.rhQ_n"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1835 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I wrote: :Zoltan Hidvegi wrote: ::> Zoltan wrote: ::> :It demonstrates a zle bug. Just load this zed function, unset the BAUD ::> :parameter (to get half-screen scrolls in zed), invoke zed -f zed, and use ::> :the up-arrow to move to the top of the function. On a 80x25 Linux console ::> :with ncurses a bogous `if [[ -f $dir/$1 ]' appears on the 5th screen line ::> :after the second half-screen scroll. :OK. I can repro it now - doesn't look good. Yep, looks like an insert problem. :Will send a fix in soon (Should be today or tomorrow (Wednesday)). Also will :change 9600 to 19200 as the minimum speed for single line scroll (unless anyone :thinks it should be 38400?) I'll go over the logic for this again to confirm it but this should fix it. I used the number of inserted characters twice in the calculations. A couple of other matters: 1) If you have a line with more than a screenful of stuff, then CTRL-U it (kill-whole-line), you don't always get your RPROMPT rewritten. I haven't found an exact repro method yet (nor checked the code). Will look into it a bit later. 2) testing "zed -f zed" lots of times and moving up and down between screenfuls twenty or more times, spewed out some allocation errors and coredumped. This is with all the ZSH_MEM stuff compiled in. The coredump didn't make sense (said it died during a putc() which was valid) and I've lost that coredump (overwritten by others) and I can't repro it. So unless someone else comes across it, nothing can be done. Perhaps it was due to my OS (NetBSD 1.2_BETA). I'm just mentioning this to encourage testers to compile in ZSH_MEM stuff Perhaps we need an option in configure: --enable-zsh-debug-all which enables all the zsh configure options? (Save me having to type in six --enable things every time :-) Anyway, here's the patch: *** zle_refresh.c 1996/07/19 17:04:33 2.9 --- zle_refresh.c 1996/07/30 05:45:42 *************** *** 122,128 **** int t0, hwinh; char *s; ! if (tline || baudrate >= 9600) { /* single line scroll */ hwinh = 1; s = nbuf[tline]; for (t0 = tline; t0 < winh - 1; t0++) --- 122,128 ---- int t0, hwinh; char *s; ! if (tline || baudrate >= 19200) { /* single line scroll */ hwinh = 1; s = nbuf[tline]; for (t0 = tline; t0 < winh - 1; t0++) *************** *** 642,648 **** nl = p1; char_ins += i; /* if we've pushed off the right, trucate oldline */ ! for (j = ccs, p1 = ol; *p1 && j + char_ins < winw; p1++, j++); if (j + char_ins == winw) *p1 = '\0'; --- 642,648 ---- nl = p1; char_ins += i; /* if we've pushed off the right, trucate oldline */ ! for (j = ccs - i, p1 = ol; *p1 && j + char_ins < winw; p1++, j++); if (j + char_ins == winw) *p1 = '\0'; -- Geoff Wing [mason@primenet.com.au] PrimeNet - Internet Consultancy