From 5c689bb50c9b2cb008356c4e5fe05b5ccff0d136 Mon Sep 17 00:00:00 2001 From: "Hideki Hamada (jakalada)" Date: Fri, 4 Jan 2019 08:00:34 +0900 Subject: [PATCH] fix `dirh` output with reversed $dirnext --- share/functions/dirh.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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