mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Simplify get_input()
This commit is contained in:
parent
984cffecc4
commit
4a2d978630
14
src/nnn.c
14
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();
|
||||
}
|
||||
#endif
|
||||
settimeout();
|
||||
return r;
|
||||
|
|
Loading…
Reference in a new issue