summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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