mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-26 03:35:17 +00:00
Fix pushd completions in the -n case
This commit is contained in:
parent
86471ac21f
commit
98b33d7b6b
1 changed files with 2 additions and 1 deletions
|
@ -10,8 +10,9 @@ end
|
||||||
function __fish_complete_pushd_minus
|
function __fish_complete_pushd_minus
|
||||||
if count $dirstack > /dev/null
|
if count $dirstack > /dev/null
|
||||||
# print each member of the stack, replace $HOME with ~
|
# 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)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue