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 <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
committed by
Lukas Fleischer
parent
7d4ef08345
commit
13d6f8703b
12
src/io.c
12
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 ();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user