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

Zsh will not parse an autoload function when it has short loops



Hello

I've created autoload function "bug" in /usr/share/zsh/.../functions, and
when run, it gives:

bug:9: parse error near `list[$i]'

Adding echo's to the file and changing various things revealed no reaction.
This means that the file isn't actually run by zsh - apparently the message
comes from some initial parsing stage.

Here is the file:

emulate -L zsh

setopt localoptions typesetsilent localtraps extendedglob shortloops

while (( 1 )); do
    # No influence, the code isn't run at all
    # typeset -a VLIST_NONSELECTABLE_ELEMENTS
    if [ ! -z "$VLIST_SEARCH_BUFFER" ]; then
        [ "$#VLIST_NONSELECTABLE_ELEMENTS" -gt 0 ] && for i
("${(nO)VLIST_NONSELECTABLE_ELEMENTS[@]}") list[$i]=()
    fi

done


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