From 13d6f8703bacfb8543c9d22c01db60e083650cad Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Sun, 13 May 2012 14:09:21 +0200 Subject: Factorize boolean user prompting. Introduce a new `status_ask_bool()` function, and use it where applicable. This greatly reduces code duplication, and will allow handling special events (resize, user escape) much more uniformely. Signed-off-by: Baptiste Jonglez Signed-off-by: Lukas Fleischer --- src/io.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index 737a198..b382e07 100644 --- a/src/io.c +++ b/src/io.c @@ -1253,16 +1253,8 @@ io_log_display (struct io_file *log, const char *msg, const char *pager) } else { - status_mesg_yesno (msg); - do - { - ans = wgetch (win[STA].p); - if (ans == 'y') - { - wins_launch_external (log->name, pager); - } - } - while (ans != 'y' && ans != 'n'); + if (status_ask_bool (msg) == 1) + wins_launch_external (log->name, pager); wins_erase_status_bar (); } } -- cgit v1.2.3-54-g00ecf