don't need line max

This commit is contained in:
Dylan Araps committed 2020-08-03 21:59:54 +03:00
1 parent 08985d6276
commit 282906b11a
1 file changed
+14 -4
+14 -4
View File
@@ -35,8 +35,6 @@ list_print() {
i=$((i + 1))
done
line_max=$i
printf '\033[%sH' "$y"
}
@@ -52,7 +50,7 @@ redraw() {
status_line() {
printf '\0337\033[%sH\033[31;7m%-*s\033[m\0338' \
"$LINES" "$COLUMNS" "${1:-$PWD ($y $y2 $line_max $bottom)}"
"$LINES" "$COLUMNS" "${1:-$PWD ($y $y2 $# $bottom)}"
}
print_line() {
@@ -105,7 +103,7 @@ main() {
;;
j?|B2) # ARROW DOWN
[ "$y" -lt "$line_max" ] && {
[ "$y" -lt "$#" ] && {
y=$((y + 1))
y2=$((y2 + 1 < bottom ? y2 + 1 : bottom))
@@ -137,6 +135,18 @@ main() {
redraw "$@"
;;
g?)
list_reset
redraw "$@"
;;
# broken
G?)
y=$#
y2=$bottom
redraw "$@"
;;
q?)
exit 0
;;