#ifndef NO_PAGER
/* display asynchrounous printf if any */
if (rdl->pager_buf != NULL) {
+ /* user ask to exit pager */
if (cmd == VT100_STD_CHAR && c == 'q') {
- rdline_printf(rdl, vt100_home);
- rdline_printf(rdl, vt100_clear_right);
rdline_asyncpager_reset(rdl);
if (rdl->pager_cb != NULL) {
rdl->pager_cb(rdl, rdl->pager_arg);
rdl->pager_cb = NULL;
}
- if (rdl->pager_buf == NULL)
- return RDLINE_RES_VALIDATED;
+ rdline_redisplay(rdl);
+ return RDLINE_RES_SUCCESS;
}
- if (rdline_pager_next_page(rdl) == 0) {
+ /* last page is displayed */
+ else if (rdline_pager_next_page(rdl) == 0) {
rdline_asyncpager_reset(rdl);
if (rdl->pager_cb != NULL) {
rdl->pager_cb(rdl, rdl->pager_arg);
rdl->pager_cb = NULL;
}
- if (rdl->pager_buf == NULL)
- return RDLINE_RES_VALIDATED;
+ rdline_redisplay(rdl);
}
- /* async printf was called in cb() */
+
+ /* pages remain, async printf was called in cb() */
return RDLINE_RES_SUCCESS;
}
#endif