From 6b2f9f880b2bed78a60c1144b0cd59b1089500eb Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 3 Aug 2020 22:17:36 +0300 Subject: [PATCH] working G/G scroll --- shfm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shfm b/shfm index 5f36c53..179fb0a 100755 --- a/shfm +++ b/shfm @@ -29,6 +29,9 @@ list_print() { i=1 end=$((bottom + 1)) + [ "$y" -gt "$bottom" ] && + shift "$((y - bottom))" + for file do [ "$i" = "$y2" ] && printf '\033[31;7m' @@ -39,7 +42,7 @@ list_print() { i=$((i + 1)) done - printf '\033[%sH' "$y" + printf '\033[%sH' "$((y > bottom ? bottom : y))" } list_reset() { @@ -102,7 +105,7 @@ main() { fi print_line "$y" "$@" - status_line "$PWD (y:$y y2:$y2 #:$# bot:$bottom" + status_line } ;; @@ -115,7 +118,7 @@ main() { printf '\n' print_line "$y" "$@" - status_line "$PWD (y:$y y2:$y2 #:$# bot:$bottom" + status_line } ;;