From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6092 invoked from network); 10 Jun 1998 04:10:43 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Jun 1998 04:10:43 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id XAA27855; Tue, 9 Jun 1998 23:57:24 -0400 (EDT) Resent-Date: Tue, 9 Jun 1998 23:57:24 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980609205803.ZM8774@candle.brasslantern.com> Date: Tue, 9 Jun 1998 20:58:02 -0700 In-Reply-To: <199806092242.PAA08814@bebop.clari.net> Comments: In reply to Wayne Davison "PATCH: revamped history-search-{for,back}ward for 3.1.4" (Jun 9, 3:42pm) References: <199806092242.PAA08814@bebop.clari.net> X-Mailer: Z-Mail (5.0.0 30July97) To: Wayne Davison Subject: Re: PATCH: revamped history-search-{for,back}ward for 3.1.4 Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"I1Dzq3.0.7p6.ZGWVr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4072 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jun 9, 3:42pm, Wayne Davison wrote: } Subject: PATCH: revamped history-search-{for,back}ward for 3.1.4 } } > It's my assertion that history-search-*ward are now broken and } > should be made to behave the way they used to (but not implemented } > the way they used to be implemented). } } My idea is that most of the time the search gets initialized when we } first leave the "curhist" line, and then we continue to execute the } last search when we're moving around in the history. Unfortunately, this doesn't work right. Consider what happens in the following case, where is history-search-backward and is up-line-or-history: zsh% ech zsh% echo this is a test zsh% fc -R historytest At the second , `histpos' remains 3 (the length of "ech"), but the first three characters of `line' are "fc ". As a result, the wrong string is searched for. This is very similar to the bug that Zefram's patch from a year and a half ago was supposed to fix; it just isn't sufficient to remember and re-use only the `histpos'. You can do a little better if you also save `hl' and reset the search if `histline' differs from the last time through, but that's still not quite right. } I happened to find and fix a few other minor problems in zle_hist.c, } but I'll send that stuff separately from this. Looking forward to it. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com