This commit is contained in:
Dylan Araps 2020-08-03 22:37:14 +03:00
parent 6b2f9f880b
commit f5ed9acc95
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 8 additions and 0 deletions

8
shfm
View File

@ -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))"