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

Problem with VCS_INFO's disable-patterns



I have the following in my zshrc:

    zstyle ':vcs_info:*' disable-patterns '/data/linux/stable(|/*)'

Now, when I switch to that directory or any of its subfolders, I get the
following error:

    VCS_INFO_set:typeset:11: not valid in this context: vcs_info_msg_-1_

When vcs_info() is executed, $maxexports apparently is 0 at:

Then, in the loop {0..-1} gets expended and fails at typeset:

Possible solution

The line before the loop contains:

    [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 ))

The condition for '-preinit-' is probably there on purpose, but for my
problem case (where $2 doesn't exist), this would work fine:

    (( maxexports == 0 )) && (( maxexports = 1 ))

But that probably doesn't fix the root of the problem and breaks stuff
in other cases.

Github: http://github.com/mhinz | Twitter: http://twitter.com/_mhinz_

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