From edf31ad035431febc2f0a55271642d7365600c57 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 29 Oct 2015 01:04:22 -0400 Subject: tui_show_prompt(): Shorten arrow key cases --- (limited to 'src/ui') 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 -- cgit v0.9.1