diff --git a/share/functions/dirh.fish b/share/functions/dirh.fish index 60c205cb2..111a76a83 100644 --- a/share/functions/dirh.fish +++ b/share/functions/dirh.fish @@ -22,8 +22,9 @@ function dirh --description "Print the current directory history (the prev and n set -l dirc (count $dirnext) if test $dirc -gt 0 + set -l dirnext_rev $dirnext[-1..1] for i in (seq $dirc) - printf '%2d) %s\n' $i $dirnext[$i] + printf '%2d) %s\n' $i $dirnext_rev[$i] end end echo