From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24244 invoked from network); 26 Apr 1999 08:47:53 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Apr 1999 08:47:53 -0000 Received: (qmail 17536 invoked by alias); 26 Apr 1999 08:47:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6109 Received: (qmail 17529 invoked from network); 26 Apr 1999 08:47:45 -0000 Date: Mon, 26 Apr 1999 10:26:29 +0200 (MET DST) Message-Id: <199904260826.KAA06833@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Fri, 23 Apr 1999 16:57:22 +0200 Subject: Re: foo= always gives context array_value Peter Stephenson wrote: > It seems that if I try to complete after an assignment, e.g. > foo= > (with new completion, obviously) $compstate[context] is always array_value, > even if there is a character which is not `(' after the =. > > Presumably the correct behaviour is that context `value' is assumed unless > there is a ( present. Of course. We lost that on the way... Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Fri Apr 23 13:28:11 1999 +++ Src/Zle/zle_tricky.c Mon Apr 26 10:14:43 1999 @@ -555,7 +555,7 @@ /* These are flags saying if we are completing in the command * * position, in a redirection, or in a parameter expansion. */ -static int lincmd, linredir, ispar, linwhat; +static int lincmd, linredir, ispar, linwhat, linarr; /* The string for the redirection operator. */ @@ -1128,7 +1128,7 @@ static char * get_comp_string(void) { - int t0, tt0, i, j, k, cp, rd, sl, ocs, ins, oins, inarr, ia, parct; + int t0, tt0, i, j, k, cp, rd, sl, ocs, ins, oins, ia, parct; char *s = NULL, *linptr, *tmp, *p, *tt = NULL; zsfree(brbeg); @@ -1192,7 +1192,7 @@ inpush(dupstrspace((char *) linptr), 0, NULL); strinbeg(); stophist = 2; - i = tt0 = cp = rd = ins = oins = inarr = parct = ia = 0; + i = tt0 = cp = rd = ins = oins = linarr = parct = ia = 0; /* This loop is possibly the wrong way to do this. It goes through * * the previously massaged command line using the lexer. It stores * @@ -1211,11 +1211,11 @@ linredir = (inredir && !ins); oins = ins; /* Get the next token. */ - if (inarr) + if (linarr) incmdpos = 0; ctxtlex(); if (tok == ENVARRAY) { - inarr = 1; + linarr = 1; zsfree(varname); varname = ztrdup(tokstr); } else if (tok == INPAR) @@ -1224,7 +1224,7 @@ if (parct) parct--; else - inarr = 0; + linarr = 0; } if (inredir) rdstr = tokstrings[tok]; @@ -1267,7 +1267,7 @@ clwpos = i; cp = lincmd; rd = linredir; - ia = inarr; + ia = linarr; if (inwhat == IN_NOTHING && incond) inwhat = IN_COND; } else if (linredir) @@ -4257,7 +4257,7 @@ } else switch (linwhat) { case IN_ENV: - compcontext = "array_value"; + compcontext = (linarr ? "array_value" : "value"); compparameter = varname; set |= CP_PARAMETER; if (!clwpos) { -- Sven Wischnowsky wischnow@informatik.hu-berlin.de