Fix pushd completions in the -n case

This commit is contained in:
Fabian Homborg 2015-10-09 20:02:28 +02:00
parent 86471ac21f
commit 98b33d7b6b

View file

@ -10,8 +10,9 @@ end
function __fish_complete_pushd_minus
if count $dirstack > /dev/null
# print each member of the stack, replace $HOME with ~
# Negative arguments are expected to start at "-0"
for i in (seq (count $dirstack) -1 1)
printf "-%s\t%s\n" $i "Rotate to "(string replace -r "^$HOME" "~" -- $dirstack[$i])
printf "%s\t%s\n" -(math $i - 1) "Rotate to "(string replace -r "^$HOME" "~" -- $dirstack[(math -$i)])
end
end
end