diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index bb51fe27..13f94e27 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -821,6 +821,8 @@ static void cmd_window_up(void) MAIN_WINDOW_REC *rec; rec = mainwindows_find_upper(active_mainwin->first_line); + if (rec == NULL) + rec = mainwindows_find_upper(term_height); if (rec != NULL) window_set_active(rec->active); } @@ -831,6 +833,8 @@ static void cmd_window_down(void) MAIN_WINDOW_REC *rec; rec = mainwindows_find_lower(active_mainwin->last_line); + if (rec == NULL) + rec = mainwindows_find_lower(-1); if (rec != NULL) window_set_active(rec->active); }