diff --git a/shfm b/shfm index 179fb0a..4a09382 100755 --- a/shfm +++ b/shfm @@ -27,8 +27,16 @@ list_print() { printf '\033[2J\033[H' i=1 + j=1 end=$((bottom + 1)) + for file do + [ "${PWD%%/}/$file" = "$OLDPWD" ] && + y=$j y2=$((j > bottom ? bottom : j)) + + j=$((j + 1)) + done + [ "$y" -gt "$bottom" ] && shift "$((y - bottom))"