correct maximum

This commit is contained in:
Dylan Araps 2020-08-03 20:34:39 +03:00
parent 33410e043e
commit 6418a1645c
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 6 additions and 4 deletions

10
shfm
View File

@ -24,14 +24,16 @@ list_print() {
printf '\033[2J\033[H\033[31;7m'
i=0
line_max=$((LINES - 3 < $# ? LINES - 3 : $#))
line_max=$((LINES - 3 > $# ? LINES - 3 : $#))
while [ "$i" != "$line_max" ]; do
printf '%s\033[m\n' "$1"
shift 1
for file do
[ "$i" != "$line_max" ] || break;
printf '%s\033[m\n' "$file"
i=$((i + 1))
done
line_max=$i
printf '\033[%sH' "$y"
}