diff --git a/.config/fish/conf.d/smartcd.fish b/.config/fish/conf.d/smartcd.fish index a3a7d44b..198752ca 100644 --- a/.config/fish/conf.d/smartcd.fish +++ b/.config/fish/conf.d/smartcd.fish @@ -25,7 +25,11 @@ function cd --wraps=cd --description "Change directory. No args goes to git root if not test (pwd) = $root __cd_orig $root else - __cd_orig - + echo "prev: $dirprev[-1] + root: $root" + if string match -q "$root" "$dirprev[-1]" + __cd_orig - + end end end end