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

Re: tag-order problem.



On May 30, 11:22pm, Tanaka Akira wrote:
} Subject: tag-order problem.
}
} I found that tag-order prevents some of completions.

(Peter, I'm afraid you're going to have to re-do this release.  Good thing
you didn't "really" announce it yet.)

} Z(3):akr@serein% Src/zsh -f
} serein% bindkey -e;autoload -U compinit; compinit -D
} serein% zstyle ':completion:*' tag-order '*:label' 
} serein% which <TAB>
} 
} This completes nothing.

I used the example of completing after `lynx' because _lynx has not been
edited since before this broke, whereas _which was changed recently.

The problem is with the change to _arguments to use a counter instead of
a shift when going around this nested loop:

    while _tags; do
      anum=1
      while [[ anum -le  $#descrs ]]; do

	action="$actions[anum]"
	descr="$descrs[anum]"
	subc="$subcs[anum++]"

        # lots deleted
      done
      # lots more deleted
    done

In the previous implementation, `shift descrs' at the point where I've put
`# lots deleted' would mean that the inner while loop consumed all the
descriptions on the first time around the _tags loop, so they were not
tried again for the second and succeeding tags.  Now, all the descriptions
are tried for every tag.  I'm not sure if that's what Sven intended, but
it breaks the `all tags not explicitly selected are tried last' behavior
in some way.

As a fast workaround, stick `descrs=()' after the inner `done', i.e. where
I've got `#lots more deleted' in the snippet above.  That's probably not
the correct fix ....

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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