diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2015-10-09 20:02:28 +0200 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2015-10-09 20:02:28 +0200 |
commit | 98b33d7b6b166b0ead2d7006df26a5789300dacc (patch) | |
tree | a966c85b8169e4bab2d81e494691bda70f972b6e /share/completions/pushd.fish | |
parent | 86471ac21f09273403708aa60dccd79944b37a52 (diff) |
Fix pushd completions in the -n case
Diffstat (limited to 'share/completions/pushd.fish')
-rw-r--r-- | share/completions/pushd.fish | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/completions/pushd.fish b/share/completions/pushd.fish index 5d9519fc..d38dc298 100644 --- a/share/completions/pushd.fish +++ b/share/completions/pushd.fish @@ -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 |