summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tui.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/tui.sh b/src/ui/tui.sh
index 2a9a1cd..c96b607 100644
--- a/src/ui/tui.sh
+++ b/src/ui/tui.sh
@@ -289,13 +289,18 @@ tui_show_menu()
KEY_UP)
[ ${curpos} -gt 0 ] || continue
curpos=$(($curpos - 1))
- # TODO: scrpos
+ if [ ${curpos} -lt ${scrpos} ]; then
+ scrpos=${curpos}
+ fi
;;
KEY_DOWN)
[ $(($curpos + 1)) -lt ${lsth} ] || \
continue
curpos=$(($curpos + 1))
- # TODO: scrpos
+ if [ ${curpos} -ge $(($scrpos + \
+ $scrh)) ]; then
+ scrpos=$(($curpos + $scrh))
+ fi
;;
KEY_HOME)
curpos=0
@@ -303,7 +308,7 @@ tui_show_menu()
;;
KEY_END)
curpos=$(($lsth - 1))
- # TODO: scrpos
+ scrpos=$(($lsth - $scrh))
;;
KEY_*);;
esac