diff --git a/src/pager.cpp b/src/pager.cpp index 175d343df..702ca0888 100644 --- a/src/pager.cpp +++ b/src/pager.cpp @@ -608,16 +608,17 @@ bool pager_t::select_next_completion_in_direction(selection_direction_t directio case direction_south: case direction_page_south: case direction_next: + case direction_north: case direction_prev: { // These directions do something sane. - if (direction == direction_prev) { + if (direction == direction_prev + || direction == direction_north) { selected_completion_idx = completion_infos.size() - 1; } else { selected_completion_idx = 0; } return true; } - case direction_north: case direction_page_north: case direction_east: case direction_west: diff --git a/src/reader.cpp b/src/reader.cpp index ae22a64f5..21af60de7 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -2970,9 +2970,9 @@ const wchar_t *reader_readline(int nchars) { // Now do the selection. select_completion_in_direction(direction); - } else if (c == R_DOWN_LINE && !data->pager.empty()) { - // We pressed down with a non-empty pager contents, begin navigation. - select_completion_in_direction(direction_south); + } else if (!data->pager.empty()) { + // We pressed a direction with a non-empty pager, begin navigation. + select_completion_in_direction(c == R_DOWN_LINE ? direction_south : direction_north); } else { // Not navigating the pager contents. editable_line_t *el = data->active_edit_line();