summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-10-29 16:27:14 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-10-29 16:27:14 (EDT)
commit1bfd71ff4fcd391d3d84cd713bbaa44090d5e883 (patch)
treeb063a6f7685a1c6940a836acd242cd56b42d4fca /src/ui
parentdf96c6a78618f47c7b14cb8338cd500dbcce6dfe (diff)
downloadfirman.sh-1bfd71ff4fcd391d3d84cd713bbaa44090d5e883.zip
firman.sh-1bfd71ff4fcd391d3d84cd713bbaa44090d5e883.tar.gz
firman.sh-1bfd71ff4fcd391d3d84cd713bbaa44090d5e883.tar.bz2
tui_show_menu(): Set ${scrpos} on KEY_UP, KEY_DOWN, and KEY_END
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