Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

-subscript- completion for assoc array



Is there some math mode behaviour still built into subscript completion?  I
can't complete the -*- elements of _comps, although they are listed all
right immediately after the [ and are entered OK with menu completion.

% $_comps[-def<TAB>

tries to complete variable names.  Significantly, it claims it's allowing
two errors and the set I get is

fignore      hep_env_sh   perl5lib     testhash     vers         
foo          keys         ret          texinputs    
fpath        lf           sets         ufmt         

so I suspect the - has been chucked out at some point.  (Since you're
wondering :-), the list consists of variables starting in f (delete two
characters) or with e second (replace two characters) or with f second
(delete one and transpose the other two).)

I don't think it matters much, but I'm now using the slightly modified
_subscript below.  (It does show I shouldn't get the variable names at all
in this case and hence compstate[parameter] isn't set properly, either.)


#defcomp -subscript-

if [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then
  compgen -k "( ${(kP)${compstate[parameter]}} )"
else
  _compalso -math-
fi


-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author