From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14652 invoked from network); 3 May 2000 07:08:19 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 May 2000 07:08:19 -0000 Received: (qmail 6210 invoked by alias); 3 May 2000 07:08:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11086 Received: (qmail 6105 invoked from network); 3 May 2000 07:08:00 -0000 Date: Wed, 3 May 2000 09:07:49 +0200 (MET DST) Message-Id: <200005030707.JAA06994@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Sun, 30 Apr 2000 09:31:16 +0000 Subject: PATCH: Re: History bug (Re: Completion debugging) Bart Schaefer wrote: > Look at this snippet of "history" output: > > 21 cd zsh-3.1.6 > 22 setup_compinit > 24 emacs /tmp/zsh149find1 ;: find\ - > 24 history > 25 emacs /tmp/zsh149find1 ;: find\ - > 26 history > 28 emacs /tmp/zsh149find2 ;: find\ > 29 emacs /tmp/zsh149echo3 ;: echo\ foo\ > 29 history > 30 reload _complete_debug > 32 emacs /tmp/zsh149find4 ;: 'find -' > 32 history > > Why are there two of numbers 24, 29 and 32? In each case, the first of the > two was inserted by calling "print -s ..." during completion. Apparently > that doesn't work very well. Of course this isn't only in completion, but in every widget. The problem is that the history number for the currently edited line is `reserved' and the `print -s' makes it be used. The patch below is the simplest solution I can think of. Bye Sven Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.12 diff -u -r1.12 builtin.c --- Src/builtin.c 2000/05/02 15:52:44 1.12 +++ Src/builtin.c 2000/05/03 07:07:17 @@ -2777,7 +2777,7 @@ int nwords = 0, nlen, iwords; char **pargs = args; - ent = prepnexthistent(++curhist); + ent = prepnexthistent(zleactive ? curhist++ : ++curhist); while (*pargs++) nwords++; if ((ent->nwords = nwords)) { -- Sven Wischnowsky wischnow@informatik.hu-berlin.de