summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-10-29 01:04:22 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-10-29 01:04:22 (EDT)
commitedf31ad035431febc2f0a55271642d7365600c57 (patch)
tree1715c42e317b420914d28b467651847de8bedc58 /src
parentcd3a9928c24d504cb67338921a3a3c1ac3178c22 (diff)
downloadfirman.sh-edf31ad035431febc2f0a55271642d7365600c57.zip
firman.sh-edf31ad035431febc2f0a55271642d7365600c57.tar.gz
firman.sh-edf31ad035431febc2f0a55271642d7365600c57.tar.bz2
tui_show_prompt(): Shorten arrow key cases
Diffstat (limited to 'src')
-rw-r--r--src/ui/tui.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ui/tui.sh b/src/ui/tui.sh
index 34c3a61..2e205c4 100644
--- a/src/ui/tui.sh
+++ b/src/ui/tui.sh
@@ -252,14 +252,12 @@ tui_show_prompt()
case "${key}" in
KEY_ENTER) break;;
KEY_LEFT)
- if [ ${curpos} -gt 0 ]; then
- curpos=$(($curpos - 1))
- fi
+ [ ${curpos} -gt 0 ] || continue
+ curpos=$(($curpos - 1))
;;
KEY_RIGHT)
- if [ ${curpos} -lt ${#input} ]; then
- curpos=$(($curpos + 1))
- fi
+ [ ${curpos} -lt ${#input} ] || continue
+ curpos=$(($curpos + 1))
;;
KEY_BACKSPACE)
[ ${curpos} -gt 0 ] || continue