Fix no jump when query begins with - in Zsh

Without this commit, the following command prints the
path found by autojump, but doesn't actually jump because
the Zsh script assumes we're passing an option to j():

    j -- -tools

The -- is needed; otherwise `-tools` would be interpreted as
a (bad) autojump option.
pull/318/head
Philippe Proulx 10 years ago
parent b60932616b
commit d12378fc15

@ -42,7 +42,7 @@ chpwd_functions+=autojump_chpwd
# default autojump command
j() {
if [[ ${@} == -* ]]; then
if [[ ${@} == -* && ! (${#} -eq 2 && ${1} == '--') ]]; then
autojump ${@}
return
fi

Loading…
Cancel
Save