Start zsh 5.0 branch

Fail loading zim if zsh version < 5.0.
Also fix git-info failing in zsh 5.0.8 as reported in #176 and #177.

Closes #201. Fixes #176. Fixes #184.
This commit is contained in:
Eric Nielsen 2017-08-02 17:29:58 -05:00
parent 83f61ddeba
commit 12e4ee29ef
2 changed files with 5 additions and 3 deletions

View File

@ -3,8 +3,9 @@
#
autoload -Uz is-at-least
if ! is-at-least 5.2; then
print "WARNING: Support for zsh < 5.2 will be removed in a future update. Update your version of zsh now to prevent any interruptions." >&2
if ! is-at-least 5.0; then
print "ERROR: Zim didn't start. You're using zsh version ${ZSH_VERSION}, and versions < 5.0 are not supported. Update your zsh." >&2
return 1
fi
# Define zim location

View File

@ -178,7 +178,8 @@ git-info() {
local ahead_and_behind_cmd='command git rev-list --count --left-right HEAD...@{upstream}'
# Get ahead and behind counts.
local ahead_and_behind=$(${(z)ahead_and_behind_cmd} 2>/dev/null)
local ahead_and_behind
ahead_and_behind=$(${(z)ahead_and_behind_cmd} 2>/dev/null)
local ahead=${ahead_and_behind[(w)1]}
local behind=${ahead_and_behind[(w)2]}