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

Re: Completion listing with ksharrays



Tanaka Akira wrote:

> In article <rsqk8lg38mu.fsf@xxxxxxxxxxxxxxxxx>,
>   Tanaka Akira <akr@xxxxxxxxxxx> writes:
> 
> > I found that `cd -<TAB>' doesn't work with ksharrays.
> > It is caused by the behaviour of dirstack parametar:
> 
> No.  I found that `cd -<TAB>' problem is not dirstack/cd dependent.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D
> is27e1u11% zstyle ':completion*' group-name ''
> is27e1u11% zstyle ':completion*:descriptions' format '%d'
> is27e1u11% ls C<TAB>
> file
> CVS/            ChangeLog       ChangeLog.3.0   Completion/     Config/
> 
> `ls C<TAB>' lists filenames beginning with `C' as above.
> 
> is27e1u11% setopt ksharrays
> is27e1u11% ls C<TAB>
> file
> 
> But when ksharrays is set, completions is not listed.

I needed some time to find out what was going on...

With ksharrays array subscripts may only be given inside `${...}' but
in _main_complete subscripts without the braces were used before
ksharrays was unset.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_main_complete Completion/Core/_main_complete
--- ../z.old/Completion/Core/_main_complete	Tue Jan 11 10:06:47 2000
+++ Completion/Core/_main_complete	Tue Jan 11 17:37:32 2000
@@ -16,14 +16,16 @@
 # which makes the output of setopt and unsetopt reflect a different
 # state than the global one for which you are completing.
 
+setopt localoptions nullglob rcexpandparam extendedglob
+unsetopt markdirs globsubst shwordsplit nounset ksharrays
 
 local comp post ret=1 _compskip _prio_num=1 format \
       context state line opt_args val_args curcontext="$curcontext" \
       _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \
-      _saved_exact="$compstate[exact]" \
-      _saved_lastprompt="$compstate[last_prompt]" \
-      _saved_list="$compstate[list]" \
-      _saved_insert="$compstate[insert]"
+      _saved_exact="${compstate[exact]}" \
+      _saved_lastprompt="${compstate[last_prompt]}" \
+      _saved_list="${compstate[list]}" \
+      _saved_insert="${compstate[insert]}"
 
 typeset -U _offered_tags _tried_tags _failed_tags _used_tags _unused_tags
 
@@ -32,9 +34,6 @@
 _failed_tags=()
 
 typeset -U _lastdescr
-
-setopt localoptions nullglob rcexpandparam extendedglob
-unsetopt markdirs globsubst shwordsplit nounset ksharrays
 
 # Special completion contexts after `~' and `='.
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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