aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 9b9b6da..70c945e 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -588,22 +588,20 @@ static void printprompt(const char *str)
static int get_input(const char *prompt)
{
- int r;
+ int r = KEY_RESIZE;
if (prompt)
printprompt(prompt);
cleartimeout();
#ifdef KEY_RESIZE
- do {
+ while (r == KEY_RESIZE) {
r = getch();
- if (r == KEY_RESIZE) {
- if (prompt) {
- clearoldprompt();
- xlines = LINES;
- printprompt(prompt);
- }
+ if (r == KEY_RESIZE && prompt) {
+ clearoldprompt();
+ xlines = LINES;
+ printprompt(prompt);
}
- } while (r == KEY_RESIZE);
+ };
#else
r = getch();
#endif