aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-05-31 20:10:11 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-05-31 20:10:11 +0530
commit4a2d978630333a72a23571c323d9a005c2cf57c1 (patch)
tree72e2caf8da2b3f9203a3f2932c7cb6fb98e97abd /src
parent984cffecc4698189ace594a14c03625e218eb735 (diff)
downloadnnn-4a2d978630333a72a23571c323d9a005c2cf57c1.tar.gz
Simplify get_input()
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 98f6d2a..de172e2 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;