From: Arun Prakash Jana Date: Sun, 31 May 2020 14:40:11 +0000 (+0530) Subject: Simplify get_input() X-Git-Tag: v3.3~85 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4a2d978630333a72a23571c323d9a005c2cf57c1;p=nnn.git Simplify get_input() --- diff --git a/src/nnn.c b/src/nnn.c index 98f6d2ac..de172e27 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -822,22 +822,22 @@ static inline bool xconfirm(int c) static int get_input(const char *prompt) { - int r; - if (prompt) printmsg(prompt); cleartimeout(); + + int r = getch(); + #ifdef KEY_RESIZE - do { - r = getch(); - if (r == KEY_RESIZE && prompt) { + while (r == KEY_RESIZE) { + if (prompt) { clearoldprompt(); xlines = LINES; printmsg(prompt); } - } while (r == KEY_RESIZE); -#else - r = getch(); + + r = getch(); + } #endif settimeout(); return r;