working G/g no scroll

This commit is contained in:
Dylan Araps committed 2020-08-03 22:12:17 +03:00
1 parent 282906b11a
commit 289f119b17
1 file changed
+11 -7
+11 -7
View File
@@ -24,12 +24,16 @@ term_resize() {
} }
list_print() { list_print() {
printf '\033[2J\033[H\033[31;7m' printf '\033[2J\033[H'
i=0 i=1
end=$((bottom + 1))
for file do for file do
[ "$i" -lt "$bottom" ] && [ "$i" = "$y2" ] &&
printf '\033[31;7m'
[ "$i" -lt "$end" ] &&
printf '%s\033[m\033[B\r' "$file" printf '%s\033[m\033[B\r' "$file"
i=$((i + 1)) i=$((i + 1))
@@ -50,7 +54,7 @@ redraw() {
status_line() { status_line() {
printf '\0337\033[%sH\033[31;7m%-*s\033[m\0338' \ printf '\0337\033[%sH\033[31;7m%-*s\033[m\0338' \
"$LINES" "$COLUMNS" "${1:-$PWD ($y $y2 $# $bottom)}" "$LINES" "$COLUMNS" "${1:-$PWD (y:$y y2:$y2 #:$# bot:$bottom)}"
} }
print_line() { print_line() {
@@ -98,7 +102,7 @@ main() {
fi fi
print_line "$y" "$@" print_line "$y" "$@"
status_line status_line "$PWD (y:$y y2:$y2 #:$# bot:$bottom"
} }
;; ;;
@@ -111,7 +115,7 @@ main() {
printf '\n' printf '\n'
print_line "$y" "$@" print_line "$y" "$@"
status_line status_line "$PWD (y:$y y2:$y2 #:$# bot:$bottom"
} }
;; ;;
@@ -143,7 +147,7 @@ main() {
# broken # broken
G?) G?)
y=$# y=$#
y2=$bottom y2=$(($# < bottom ? $# : bottom))
redraw "$@" redraw "$@"
;; ;;